Categories
Emacs GNU/Linux Free Software & Open Source

Paying for a text editor

programming

Lifehacker published an article about how a plain text code editor called Textastic rivals the famous Textmate in features with a lower price. I find this kind of articles a bit funny when the “fathers” of almost all text code editors are Emacs and Vi, both of which free as in freedom and cost. Why would anyone pay for a proprietary product that has only a subset of features from these two? It’s beyond my comprehension.

I can understand it a bit more when comparing text editors to IDEs like Eclipse, Netbeans or Zend Studio, which have their unique connectors and fancy things to debug stuff (like the whole Android development kit, which is, by the way, also available at no cost). But when talking about text editors, I really don’t see the advantages.

In this case, since I’m an Emacs user, I can only compare to that. If you’re a Vi(m) user, leave some tips in the comments.

On the features mentioned in the article it talks about code completion and highlighting for “many popular languages”, when Emacs has that for those, plus the unpopular ones. Both Vi and Emacs run on the three major platforms (Gnu/Linux, OS X and Windows) and there are some mobile versions of them too. In any case, you can use them through a remote terminal on your device. Autosaves and versioning are built in on Emacs since I don’t know how many years ago, it also has theming since about two years ago. Emacs also supports “textmate snippets” using YaSnippet mode. To manage files I haven’t seen anything more powerful than Dired mode and you can even view images and PDF files inside your text editor.

There is so much more you can do using Emacs as your text editor. The advantage of learning one tool for many tasks is that you won’t need to relearn new commands, workflows or keyboard shortcuts. But there are also many other alternatives: Vi, Nano, Kedit, Gedit, Notepad++ and the list goes on.

So my question still remains: Why do people pay for sub-par products when better options are available at no cost?

Categories
Emacs GNU/Linux Free Software & Open Source

Emacs Identica-mode 1.3.1: Quick bug fix release

code bug

I just want to give a heads up to all who downloaded Identica-mode 1.3 that some bug fixes were done yesterday very quickly and the oficial stable release is 1.3.1 as of now. The main issue was a bug displaying all messages highlighted as replies when the timeline was in ‘oldest first’ preference mode. Also there were some other minor fixes.

The link on the previous post points to the latest release, but you can download Identica-mode 1.3.1 here as well.

I’d like to give special thanks to Alexandre Oliva for his feedback and very quick response sending the patches for this.

Code bug photo is Creative Commons by Gui Tavares on Flickr
Categories
Emacs GNU/Linux Free Software & Open Source

Identica-mode 1.3 release

favorite message marked in timeline
Favorite messages are now marked in timeline

After the buggy 1.2.1 release and a long bug fixing development time, the new Identica-mode 1.3 is released. Lately I’ve been relying more on releasing through package.el and the MELPA repository whenever I push changes to the main branch on the Git repository. But then I received some emails requesting for an official stable release for package maintainers and for people who don’t feel comfortable using development releases.

### What changed

Among many of the changes and bug fixes, here are the most relevant:

– Fix eLisp functions incompatibilities between some builds of Emacs 23.1 and later versions (a big bug in 1.2.1 release)
– Auto-detect from server instance the character limit
– Added favorite icon on format line to identify favorite messages
– Format line can now display user profile URLs using “%U” token
– Added reply to all feature, by pressing ‘A’ on a message will reply to sender and all mentioned usernames
– Fixed ur1.ca URL shortening bug returning the DTD instead of the real link
– Added highlighting of replies without username mention (the new reply format on Status.net 1.x)
– Conversations (context) can now be retrieved by pressing C-c C-c on any message.
– Remote user timeline retrieval with C-c C-o
– On identica-friends list, pressing ENTER in a group or user makes Identica to load its timeline.
– Deletes HTTP retrieved temporary buffers to avoid high memory usage over time
– Optimized fontification code that renders the timeline in the buffer
– Many fixes and optimizations

You can review the history of the project’s development at Identica-mode’s code repository web interface.

### Get it

Click to download Identica-mode 1.3 release

Or if you prefer to get the latest releases using MELPA repository for package.el which is now part of Emacs 24.

Or get the latest development code directly from the Git repository without using package.el at
http://git.savannah.gnu.org/cgit/identica-mode.git

### Contribute

Your feedback, bug reports and code contributions are really appreciated to keep improving this project. Contact me on Identi.ca or send a message to the Identica-mode group. You can also donate a tip via Paypal.





Categories
Emacs GNU/Linux Free Software & Open Source

Quick note taking with Emacs and Org Capture

Taking notes has to be a taks that is fast, easy and must not get in the way of the things you’re doing. How many times do we forget something because we didn’t write it down right away? Or how many times you didn’t took a note of something because you don’t have a quick and simple way to easily write down that idea for later use?

Using Emacs for most of my daily workflow and Org mode as my organizing GTD system, having a quick way to take notes and store ideas or links quickly is a huge advantage. This is the fastest note taking system I’ve used so far and even if you’re not using Emacs or Org mode, this feature alone is worth spending a little time learning the tools.

Remember mode was the way to capture ideas fast and easy without getting in the way. Until Org mode version 6.36, you had to hook up remember mode to interact with Org to capture your notes. Now you don’t need to since there’s Org Capture. It is part of Org mode and it’s got all the functionality of remember mode with the advantage of being built-in with Org mode.

Setup org-capture with global keybindings so that no matter what you’re doing (within Emacs) you can quickly capture something with a fast shortcut. I like to bind it to C-c r

(setq org-default-notes-file (concat org-directory "/notes.org"))
;; Bind Org Capture to C-c r
(global-set-key "\C-cr" 'org-capture)

If you are using Emacs prelude setup a different shortcut because this one will conflict with prelude rename command. Since I’m already wired to use that shortcut and I barely use the prelude-rename command that often, I added this to my setup:

;; Unbind prelude rename command
(global-unset-key "\C-cr")

Like with remember mode, you can set up templates for your captured notes. If you’re already using Remember mode, you can import your old templates to the new org-capture templates. To convert your org-remember-templates, run the command:

M-x org-capture-import-remember-templates 

Here’s an example of two templates I always set up with org-capture:

;; Org Capture
(setq org-capture-templates
      '(("t" "Todo" entry (file+headline (concat org-directory "/gtd.org") "Tasks")
         "* TODO %?\n %i\n")
        ("l" "Link" plain (file (concat org-directory "/links.org"))
         "- %?\n %x\n")))

The first one will capture a TODO entry under the headline Tasks inside the file gtd.org in my org directory. I’ll use this one whenever I want to add a todo task quickly. The second one will copy the contents of my clipboard and will paste it as a new entry in the file links.org as a list item without any header and will have my cursor ready to type the item list description. This one I use it when I want to save a link url, typically a bookmark from the browser, in my links.org file to consult it later.

To access each template, a key has been set for each. When org-capture is run, it will prompt you what you want to capture. Press ‘t’ for a Todo or press ‘l’ for a link. You can add more templates to suit your needs with the extensive template options described in the Org manual.

org-capture
Using org-capture

Finish the capturing process by typing C-c C-c which runs org-capture-finalize and the capture buffer will disappear so you can continue what you were doing without interruption.

Note photo by [email protected] on Flickr
Categories
Emacs GNU/Linux Free Software & Open Source

MobileOrg for Android setup and workflow

MobileOrg

Here’s a quick post on how I setup MobileOrg for Android

First of all, get the MobileOrg app from the Google Play Store. In my case, I set it up to work with my Dropbox account. The setup wizard is very simple and really the confusion or configuration relies on the desktop side with your Emacs setup.

According to the Org mode manual about MobileOrg, you have to setup the following:

You need to tell orgmode where all your org files will be stored. In my case I put them inside a ‘org/’ in my home directory.

;; Org mode
(setq org-directory "~/org")

Then you need to configure this two OrgMobile settings. The first variable “org-mobile-directory” must point to your local dropbox folder, the same path you indicated on your mobile device when configuring the app. The second one is the index file that MobileOrg will use to keep track of changes and other temporary stuff. I put it inside my org-directory for simplicity.

;; MobileOrg
(setq org-mobile-directory "~/Dropbox/MobileOrg")
(setq org-mobile-inbox-for-pull (concat org-directory "/index.org"))

Make sure the index.org file you indicated exists, if not create an empty file in that path.

Workflow

Now comes the simple part on how to work with it. All you have to do to make your org files available to the app is to run:

M-x org-mobile-push


On the app, just push the synchronize button each time you make any changes so they can be pulled on the desktop side with:

M-x org-mobile-pull

And that's it! Very simple and useful. I still think the MobileOrg app needs a lot of UI improvements but it's nice to have you org notes available at anytime and easy to edit without using only a text editor on a mobile device.

Categories
Emacs GNU/Linux Free Software & Open Source Programming & Web Development

Easy CSS editing with Emacs

Editing CSS in Emacs is very easy since the standard CSS mode comes included by default. But developer Julien Danjou created this nice minor mode called rainbow-mode which will display the color of the code as the background of the code’s text. It is very useful to immediately see the colors right there in the style sheet instead of trying to remember each code and then test in the browser window.

One of the problems I had was when opening any CSS file, it would open by default css-mode, but I had to manually load rainbow-mode every time. The elisp function auto-mode-alist is used to detect a file type by its name and running a function associated with it, generally the function to enable a major mode to edit that type of file. For minor modes I couldn’t find anything that would allow me to launch them without inhibiting the mayor mode’s startup.

So since auto-mode-alist takes a regular expression for the file type and only one function as its arguments, I wrote a function that will run both and use that as the second argument to execute.

;; CSS and Rainbow modes 
(defun all-css-modes() (css-mode) (rainbow-mode)) 

;; Load both major and minor modes in one call based on file type 
(add-to-list 'auto-mode-alist '("\\.css$" . all-css-modes)) 

Hope you find it useful and you like the combination of css-mode and rainbow-mode as much as I do.