<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Elisp on /usr</title><link>https://slashusr.anupamsg.me/tags/elisp/</link><description>Recent content in Elisp on /usr</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 30 Dec 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://slashusr.anupamsg.me/tags/elisp/index.xml" rel="self" type="application/rss+xml"/><item><title>What's New in Emacs 24.4</title><link>https://slashusr.anupamsg.me/2013/12/30/whats-new-in-emacs-24-4-2/</link><pubDate>Mon, 30 Dec 2013 00:00:00 +0000</pubDate><guid>https://slashusr.anupamsg.me/2013/12/30/whats-new-in-emacs-24-4-2/</guid><description>&lt;p&gt;&lt;a href="http://www.masteringemacs.org/about/"&gt;Mickey Petersen&lt;/a&gt; has written up an excellent round-up of the latest features of the &lt;a href="http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00500.html"&gt;Emacs 24.4&lt;/a&gt; release.&lt;/p&gt;
&lt;p&gt;Read the whole article at &lt;a href="http://www.masteringemacs.org/articles/2013/12/29/whats-new-in-emacs-24-4/"&gt;http://www.masteringemacs.org/articles/2013/12/29/whats-new-in-emacs-24-4/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;He had also written a similar article for Emacs 24.3 (current stable version), which can be found &lt;a href="http://www.masteringemacs.org/articles/2013/12/29/whats-new-emacs-24-3/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="new-settings-that-i-am-using"&gt;New Settings that I am using&lt;/h2&gt;
&lt;p&gt;I have already setup the &lt;code&gt;load-prefer-newer&lt;/code&gt;, &lt;code&gt;cycle-spacing&lt;/code&gt;, and &lt;code&gt;ns-use-srgb-colorspace&lt;/code&gt; options.&lt;/p&gt;
&lt;p&gt;The new &lt;code&gt;electric-pair-mode&lt;/code&gt; options also look interesting, and I have set these up (I was using &lt;code&gt;skeleton-pair&lt;/code&gt; for the auto-pairing function till now).&lt;/p&gt;</description></item><item><title>Emacs function to add new path elements to the $PATH environment variable</title><link>https://slashusr.anupamsg.me/2010/01/20/emacs-function-to-add-new-path-elements-to-the-path-environment-variable/</link><pubDate>Wed, 20 Jan 2010 00:00:00 +0000</pubDate><guid>https://slashusr.anupamsg.me/2010/01/20/emacs-function-to-add-new-path-elements-to-the-path-environment-variable/</guid><description>&lt;p&gt;A very simple eLisp function to add new path elements to the PATH environment variable. Very useful for adding new &lt;strong&gt;comint&lt;/strong&gt; executables from within &lt;strong&gt;.emacs/init.el&lt;/strong&gt; files.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;(defun my-add-path (path-element)
&amp;#34;Add the specified path element to the Emacs PATH&amp;#34;
(interactive &amp;#34;DEnter directory to be added to path: &amp;#34;)
(if (file-directory-p path-element)
(setenv &amp;#34;PATH&amp;#34;
(concat (expand-file-name path-element)
path-separator (getenv &amp;#34;PATH&amp;#34;)))))
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Google Search from within Emacs</title><link>https://slashusr.anupamsg.me/2010/01/19/google-search-from-within-emacs/</link><pubDate>Tue, 19 Jan 2010 00:00:00 +0000</pubDate><guid>https://slashusr.anupamsg.me/2010/01/19/google-search-from-within-emacs/</guid><description>&lt;p&gt;A quick and dirty eLisp function for searching on the internet from within Emacs. The default is to search using Google, but you can add to the &lt;strong&gt;*internet-search-urls*&lt;/strong&gt; variable to setup additional search URLs.&lt;/p&gt;
&lt;p&gt;By default, the search term is appended at end of the URL - however, you can also encode the specific search term insertion point in the URL by marking the position using the &lt;strong&gt;“%s”&lt;/strong&gt; marker.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;;;; The custom search URLs
(defvar *internet-search-urls*
(quote (&amp;#34;http://www.google.com/search?ie=utf-8&amp;amp;oe=utf-8&amp;amp;q=%s&amp;#34;
&amp;#34;http://en.wikipedia.org/wiki/Special:Search?search=&amp;#34;)))
;;; Search a query on the Internet using the selected URL.
(defun search-in-internet (arg)
&amp;#34;Searches the internet using the ARGth custom URL for the marked text.
If a region is not selected, prompts for the string to search on.
The prefix number ARG indicates the Search URL to use. By default the search URL at position 1 will be used.&amp;#34;
(interactive &amp;#34;p&amp;#34;)
;; Some sanity check.
(if (&amp;gt; arg (length *internet-search-urls*))
(error &amp;#34;There is no search URL defined at position %s&amp;#34; arg))
(let ((query                          ; Set the search query first.
(if (region-active-p)
(buffer-substring (region-beginning) (region-end))
(read-from-minibuffer &amp;#34;Search for: &amp;#34;)))
;; Now get the Base URL to use for the search
(baseurl (nth (1- arg) *internet-search-urls*)))
;; Add the query parameter
(let ((url
(if (string-match &amp;#34;%s&amp;#34; baseurl)
;; If the base URL has a %s embedded, then replace it
(replace-match query t t baseurl)
;; Else just append the query string at end of the URL
(concat baseurl query))))
(message &amp;#34;Searching for %s at %s&amp;#34; query url)
;; Now browse the URL
(browse-url url))))
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Quickly diff the changes made in the current buffer with its file</title><link>https://slashusr.anupamsg.me/2010/01/19/quickly-diff-the-changes-made-in-the-current-buffer-with-its-file/</link><pubDate>Tue, 19 Jan 2010 00:00:00 +0000</pubDate><guid>https://slashusr.anupamsg.me/2010/01/19/quickly-diff-the-changes-made-in-the-current-buffer-with-its-file/</guid><description>&lt;p&gt;&lt;em&gt;Update (23rd Jan 2010): Separated the key-assignment and  function definition.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A simple function to quickly do a diff of the current buffer contents with its underlying file. Very useful if the file has been changed outside (e.g., a log file).&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;;; Diff the current buffer with the file contents
(defun my-diff-current-buffer-with-disk ()
 &amp;#34;Compare the current buffer with it&amp;#39;s disk file.&amp;#34;
(interactive)
 (diff-buffer-with-file (current-buffer)))
(global-set-key (kbd &amp;#34;C-c w&amp;#34;) &amp;#39;my-diff-current-buffer-with-disk)
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>