<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Unix HOWTOs and Tips &#187; emacs</title>
	<atom:link href="http://blog.bulsynt.org/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.bulsynt.org</link>
	<description>Short unix command line administration tips and scripts</description>
	<lastBuildDate>Wed, 30 Oct 2019 07:51:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using jed with different encodings &#8211; utf8 and cp1251.</title>
		<link>https://blog.bulsynt.org/2011/03/06/how-to-use-jed-with-different-encodings-utf8-and-cp1251/</link>
		<comments>https://blog.bulsynt.org/2011/03/06/how-to-use-jed-with-different-encodings-utf8-and-cp1251/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 01:22:40 +0000</pubDate>
		<dc:creator>Delyan Angelov</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[cp1251]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[jed]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[windows1251]]></category>

		<guid isPermaLink="false">http://blog.bulsynt.org/?p=3</guid>
		<description><![CDATA[Maintaining websites through remote ssh connections, requires using console editors which should start fast, do not require huge amounts of memory and are easy to use. The powerfull editors Vim and Emacs are not good for this task - although VIM is virtually guaranteed to be installed and it is fast, can be customized and [...]]]></description>
			<content:encoded><![CDATA[<p>Maintaining websites through remote ssh connections, requires using console editors which should start fast, do not require huge amounts of memory and are easy to use.</p>
<p>The powerfull editors Vim and Emacs are not good for this task - although VIM is virtually guaranteed to be installed and it is fast, can be customized and so on, it is hardly easy to learn. Emacs may be easier, it has menus and tutorial, it is very customizable, but is not too fast to start.</p>
<p>In contrast, <strong><a title="Jed" href="http://www.jedsoft.org/jed/download.html" target="_blank">Jed</a></strong> is a very light weight editor which is ideal for quick changes, because it starts instantly, supports syntax highlighting for many common programming languages and has good UTF8 support. It has emacs like macro recorder, buffers, and auto indenting too. It also supports emacs keyboard shortcuts by default, so if you use emacs for longer programming sessions, you probably will like jed when you need to edit quickly some remote files.</p>
<p>Unfortunately bulgarian texts (and sites) are often written using 2 different common encodings, and so there is a catch - you need some tweaks for your programs (and jed in particular), to support both encodings equally well:</p>
<p>In order to edit utf8 files with <strong>jed</strong>, first, you need to have the correct bulgarian locale for utf8 generated.<br />
You can do this using this command:</p>
<pre class="brush:shell">sudo localedef -i bg_BG -f UTF-8 bg_BG.UTF8</pre>
<p>You can install <strong>jed</strong> and some <strong>jed</strong> goodies with the following instructions (Debian/Ubuntu):<br />
<strong><code></code></strong></p>
<pre class="brush:shell">sudo apt-get install jed jed-extra jedstate</pre>
<p>For RedHat/Centos, try to google for a <strong>jed</strong> rpm, or try:</p>
<pre class="brush:shell">wget  ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/jed-0.99.18-5.el5.kb.i386.rpm
rpm -i jed-0.99.18-5.el5.kb.i386.rpm</pre>
<p>Next, you add these lines to your <strong>.bashrc</strong> file:</p>
<pre class="brush:shell">alias jed.cp1251='LANG=C jed'
alias jed.utf8='LANG=bg_BG.UTF-8 jed'</pre>
<p>Restart your shell, or do:</p>
<pre class="brush:shell">source ~/.bashrc</pre>
<p>in your current shell, so that the changes can be applied.</p>
<p>After all this preparation, when you want to edit a file encoded using utf8, do it like this:<br />
<code><strong></strong></code></p>
<pre class="brush:shell">jed.utf8    FILENAME</pre>
<p>For cp1251/windows1251, the command should be:</p>
<pre class="brush:shell">jed.cp1251   FILENAME</pre>
<p>&nbsp;</p>
<p>Note, that the selected encoding of your terminal application should match the encoding of your editor, or else you will see some funny characters instead of the proper ones. For this and other reasons, I recommend you to use the KDE's <strong>konsole</strong> application. It is stable, has good internationalization support, and it is pretty fast, even when you have a large scroll buffer.</p>
<p>You can also use <strong><a title="PuTTY" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">PuTTY</a></strong> in case you are trapped in a windows only shop <img src='https://blog.bulsynt.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  .</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.bulsynt.org/2011/03/06/how-to-use-jed-with-different-encodings-utf8-and-cp1251/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
