Showing posts with label Emacs. Show all posts
Showing posts with label Emacs. Show all posts

Saturday, January 28, 2012

Debian Wheezy - Web Browsers

v0.3.1

I've been working with Debian Wheezy with Virtualbox.  It occurred to me that I've long ago stopped talking about how to install Debian within VBox, and have transferred to talking about Wheezy itself.  Hopefully naming the posts about what they really are will be more productive.

Whilst purists might disagree, I think that using synaptic is a wonderful and easy tool to explore the world of Debian packages.  The sections are nicely laid out and it is easy to see which packages meet your search criteria .. and who knows, you might find some wonderful gem you never thought existed.

Take Web Browsers for example ......

When you search on that, some really interesting variants appear.
  • Chromium from which Google Chrome is derived.  And it accepts the Google extensions.
  • IceApe.  The Debian version of SeaMonkey which is the Mozilla version of Netscape.
  • Dillo.  It is a cool, FAST web browser.  Yes, a little basic but did I mention is is FAST.
  • Conkeror.  Emacs.  But this one does graphics.
  • W3m.  Emacs.  But this one doesn't.
  • Links2.  Just on 2 meg and it is not bad ...
  • Lynx
Whilst there are a few more, I just wanted to illustrate what you can find.  I know there are the standard Gnome and KDE browsers, but at the  moment I'm inclined to avoid them since upon installing them you are obliged to install the majority of the appropriate desktop and whilst this might be fine for you, that is not what I'm looking at here.

I guess what I'm trying to point out is that the Debian repository of software is pretty extensive, and whilst I'd like to get back to configuring the overall system and finding those tips and tricks that seem elusive, there is so much to be found in Synaptic.


Later ........

Further to the above ....

I did of course negelect Debian's Firefox - IceWeasel which is provided in the latest variant.


:)

Friday, October 14, 2011

Finding Emacs - Colours,Toolbar and Variables

v 0.2
14 oct 11


Colours

I was wondering about setting colours in Emacs ... and then started wondering about Themes and even how to find out what variables to set.

Well, here is a website that gives all the colours you can set:


http://raebear.net/comp/emacscolors.html

How can you use them?  Well to start off, try putting this in your init file ....

(set-background-color  "grey95")

It is a very simple change - changes the background to light grey, however you get the idea.


Themes

Try this website to view a few:
http://color-theme-select.heroku.com/

Toolbar

Want to determine whether the toolbar is on or off?

(tool-bar-mode t)


Variables

I found this list this morning, however there are a lot more than this:
http://www.gnu.org/s/libtool/manual/emacs/Variable-Index.html


Later ....

Wednesday, October 12, 2011

Finding Emacs - Aquamacs and Emacs on OSX

v0.2
12 Oct 11

I have both Aquamacs and Emacs on my Mac laptop.  Aquamacs is a really good adaptation of Emacs to the OSX environment, particularly for "non-geeks".

One aspect of Aquamacs has had me wondering about it over the last few weeks - that of initialisation.  If you read the aquamacs manual, it tells that it reads its own customisation and preferences files first and then it reads " .emacs ".

Experimentation tells me that Aquamacs does NOT read the initialisation files contained in " .emacs.d " as per the latest emacs variants.  The only problem with this is if you do not know about it.  Simply overcome - have your " preferences.el " and your " init.el " files load the things you want them to load.

Done!


later.

Friday, August 26, 2011

Finding Emacs - Orgmode and PDF, Text, Html export

v 0.2

I have really found Orgmode useful over the last year or so.  I learn a small bit of it as I go and I think it is one of the most useful tools out there.  I normally use the standard text export for its ease of use - it impresses people that you can produce a professional looking document with standard text.

First though, a couple of tips from the manual.  When you export, you can over-ride the defaults to produce the meta-data you want.  Simply make the first lines of the file something like:

 -*- mode:org ; mode:visual-line  -*-
#+STARTUP: indent
#+OPTIONS: H:4
#+TITLE: The Title I want On the Document
#+AUTHOR: Archer of Gorgon
#+DATE: Feb 31
#+EMAIL: archer@gorgon.org.gg


Formatting for HTML and PDF

When you write your orgmode document, make sure it is structured correctly, otherwise when you export to HTML or PDF, lines will run into each other.  I was writing lists of action items to myself such as:

Takeoff RWY 16 Mel
Dosel departure
Tcas event
STAR
RNAV FLS 34
Go Around
RWY 34 VOR  FLS
Land

and it would be exported under HTML and PDF to:

Takeoff RWY 16 MelDosel departureTcas eventSTARRNAV FLS 34Go AroundRWY 34 VOR  FLSLand

Not quite what I wanted.  What I should have done was to use the "table" function, with one cell per row or .. 

#+begin_example

#+end_example

Others are here:
http://orgmode.org/manual/Easy-Templates.html#Easy-Templates

  
Export to PDF

Orgmode CANNOT export from EMACS to PDF by itself.  You need the "pdflatex" program.  I am using my Windows 7 desktop as my main machine, so I haven't checked with Mac or Linux however ... I installed MikTex and all was well .....  There will be equivalent packages ..

Utterly beautiful PDF files.

Note:  The first run, it will take some time however subsequent runs happen within seconds.


That is it.



Later.


Monday, February 7, 2011

Finding Emacs - Ccrypt Encryption and Default Load Path

v 0.1
I was spending some time poking around some Emacs information and came across this page explaining how to use ccrypt to automatically encrypt files.

http://myridia.com/dev_posts/view/638

It showed the location for obtaining ccrypt and the emacs " el " file to use it.

http://ccrypt.sourceforge.net/


The important point I gained from the article was that the " .emacs.d " directory is the default load path for emacs, so just placing the " el " files in this directory means they are automatically readable by emacs on startup.


... Later

Thursday, January 13, 2011

Finding Emacs - "Learning GNU Emacs"

v 0.2
I was googling for some information on "nroff-mode" in Emacs, and unexpectedly, I found a Google copy of "Learning GNU Emacs" in Google Books.

I now have found two brilliant books on Emacs.  First is the reference manual by Richard Stallman, and the second is this.  From what I've read of it so far, I think Amazon will sell another copy.  Unlike most, this is more of a TUTORIAL rather than a reference manual, so it lets you put things in perspective.

As I have come to realise, Emacs is a long term project - but one which will repay the effort many times over.



Later.

Update

There are significant differences between the 2nd and 3rd editions.  For example, Mail is not covered in the 3rd edition.

Saturday, January 8, 2011

Text - Groff and Mom

v 0.3

I've always had a partiality towards producing documents using text markup.  It has been limited in the past towards having a play writing my on personalised "Man" pages for my Linux machine, or writing html using markup (which drives my Nephew nuts because he likes Dreamweaver).  It rubs off onto my Daughter as well, since she prefers markup for her html coding as well.  Perhaps the fact that she is a Script-writer has something to do with it.

I was interested to see that Groff is included in my Cygwin install (unsurprisingly) so I started to wonder if it was a useful tool for writing letters and other documents.  If you have a useful template, then just changing some of the content is far easier than opening a Word Processor and starting afresh - or even finding that letter that you wrote some time ago to change a few things.  Of course, that the hardware needs of such a system are far less than the requirements of a Word Processor come into play.

The first thing I stumbled on was this linxgazette article on Groff and Mom.  So then I went to the Mom Homepage and started reading further.  Despite Mom being included in Groff (and it is, in Cygwin as well) I downloaded the latest version of Mom to have a look.  Within the file there is the documentation and numerous examples, as well as the macro definition file " om.tmac ".  There is an " install " file to read, however in the end, if you put the " om.tmac " file in the home directory, all should be well (though I haven't tried that yet).

The moment of truth.  I opened a Cygwin command line window, which, since I've set the HOME environment variable, opened in my HOME directory.  I'm not going to go into the logic of the Unix command line here - please refer elsewhere - the Rute User Tutorial on the links page is an excellent place to start.  Using one of the sample " mom " files that came with the Mom download:

groff -mom letter.mom > letter.ps

And low and behold, a postscript file appeared.  The documentation had a slightly different syntax to send the file to the printer, so I tried that, even though my default printer is not postscript.

groff -mom -Tps letter.mom | lpr

The raw postscript printed fine on my default printer, so even though I didn't have the "beautiful" result at this stage, I did know that the command line worked and sent files to the printer.

Windows does not have the capabilities to read postscript files in a viewer that other operating systems do, so the next step is to get Ghostscript, the free Postscript interpreter and viewer.  The presentation of postscript files is a little problematical, depending on the font that is used, however the printed article seems to work fine.

There is a script included in Ghostscript that you can use to convert the file to a "pdf" file.

ps2pdf letter.ps > letter.pdf

NOW you can open the letter in a pdf viewer and print it from there.  You'll notice that the clarity of the text in pdf format is MUCH better than the postscript viewer.

All you have to do now is read the documentation, and have a play.  You are up and running with Mom!!

Update 17th Jan

Other Macro Packages

The other two macro packages I could find documentation for were the "ms" and "me" packages showing how to use them.  See the Links page.


Using Emacs to Edit Groff

Emacs has a built in " nroff " mode.  To activate it, either issue issue the command via:

M-x nroff-mode

or making the first line of your Groff source document:

\" -*- mode:nroff -*-

\"  is the comment in Groff, so the mode instruction line will remain invisible.  Using Nroff mode, all macros will be highlighted for easier editing.


Later ....

Thursday, December 30, 2010

Finding Emacs - An Intermission

I've been having fun working through what Emacs is all about over the last few months.  It is interesting to see what makes it so popular, and since I've also been a fan of VI and VIM, the comparison has been interesting.

Whilst I still think that knowing Vi is essential (it is ALWAYS available for a strange system), Emacs has an irresistible attraction - being built upon a lisp interpreter opens up all sorts of possibilities.  I am firmly sold on Orgmode, and my blog posting of using it with gpg for encryption, whilst basic shows the possibilities.  Symmetric encryption with gpg also makes one wonder why bother with other utilities ....

The thing of beauty that is Emacs is that it is available for whichever platform you use, it is extensive and the effort required to learn it will be repaid many times over in a lifetime.  The term "core competency" comes to mind.

Another thing I've come to accept is that Emacs requires effort to learn.  There is no really easy way.  First do the tutorial, perhaps look at a few websites, but READ the MANUAL.  Let the brain think about it and move on from there.  You cannot learn the piano in a week.

On Windows, if you want to use Emacs, then load Cygwin for any supporting binaries.  Cygwin is just essential.

In a way, the whole thing rather mirrors my journey learning Linux.  At first it was strange, and I bought a boxed set of SuSe Linux about 10 years ago, then I used Red Hat for a while and then Slackware (what a wonderful system).  Finally I settled on Debian.  Only today I was looking at a Windows setup and thinking how much easier Debian was to deal with.

About a year ago, I did a couple of posts about Debian Squeeze as it was then.  There were a few problems as could be expected of it at that stage in its development, however now it is days away from becoming the new Debian Stable.  It is a wonderful system.  Like Emacs, the effort expended in learning Debian Linux is repaid many times over.

But then, like so many things in life, we cannot appreciate these things until we have undertaken the journey.


Later.....

Tuesday, December 21, 2010

Finding Emacs - A Personal Information Manager Part 1

Over previous posts, I've been building Emacs capabilities.  It occurred to me that I had a secure information manager that I could take anywhere with me and that I could recover anywhere.

Here are the components.

  • Emacs
  • My Encryption post
  • My Orgmode Outlines post
  • DropBox

Use an Orgmode outline to structure your data - save it using encryption previously described and then copy it to Dropbox.  Secure, and you can re-create the information on ANY platform with nothing but the knowledge it can be done, this Blog, and Dropbox.

Sounds good to me.




later .......

Finding Emacs - RMail - SUCCESS!!

Emacs has an inbuilt mail program, RMail.  This is a basic mail client that was originally intended to read mail that had been already imported to the local machine or onto the network by a Mail Transport Agent.  If you configure Rmail for POP/SMTP then RMail will take over Emacs while it is retrieving mail - you will lose all multi-tasking and Emacs will appear to freeze. You have been warned.

RMail and Copying Mbox Mail

Want to read mail in the Apple Mail folders on OSX in RMail?

Set the mail file to:

Mail: ~/Library/Mail//INBOX.mbox/mbox

ie in init.el

(setq rmail-primary-inbox-list '("Mail: ~/Library/Mail//INBOX.mbox/mbox"))

then
`rmail-preserve-inbox' to non-`nil'

ie in init.el

(setq rmail-preserve-inbox t)

RMail will now copy the mbox file over to the RMail file for you to use.  

NOTE- WARNING - I have not tried this, just tried to figure out what a few posts have said..


RMail and POP Access
After some experimentation, here is the init.el file config that worked for me. I was able to log on to my local ISP with POP and to retreive email, then to send email as well. The mail was deleted from the server when I retreived it.

;; email address 
(setq user-full-name "Firstname Lastname") 
(setq user-mail-address "username@ispname.com")

;; Movemail Program - modify your path as required 
(setq rmail-movemail-program "c:\\pro\\emacs-23.2\\bin\\movemail.exe")

;;POP
(setenv "MAILHOST" "yourISP_Pop_servername") 
(setq rmail-primary-inbox-list '("po:username@ispname.com"))
(setq rmail-pop-password-required t)  

;;SMTP 
(setq smtpmail-default-smtp-server "yourISP_smtp_servername") 
(setq smtpmail-local-domain nil) 
(setq send-mail-function 'smtpmail-send-it)
(load-library "smtpmail")

NOTE: I had to use the format for the POP line "po:username@ispname.com" to make it work.


later ...

Update 24Dec10:

  • Corrected the POP config - some formatting had been lost in the bit-bucket.
  • Movemail program that is included with Emacs will only perform non-SSL connections. Gnu has a more complete version, however I have not found a binary for Windows. As its name suggests, its purpose is to move mail between points.



Disclaimer: You will be vewy vewy careful with the above instructions!

Sunday, December 19, 2010

Finding Emacs - Mail, the Bad and the Good

Having heard that Emacs has two built in email clients (rmail, gnus) I've been trying to get them to work for me.  Everywhere I've read, I have seen people frustrated at not being able to get imap working, and complaining that Emacs freezes when it starts dealing with mail.  So, why is this and is there anything we can do about it?

RMail and Gnus were originally intended to deal with mail from the local network, not remote servers on the internet.  If RMail, for example, is collecting mail from a POP server, then Emacs multi-tasking is lost and it "freezes" until that mail collection is complete.  The good news is that Emacs does come with the "Movemail" program needed to communicate with POP servers, so all this can be done from within Emacs.

Setting up email in Emacs comes at a cost.

The conclusions I've come to are that to use mail effectively, Emacs needs an external mail transfer agent to do the work of transferring the mail to and from the Internet, and then the mail client can do the email management.  Once we make that breakthrough in thinking, the process becomes much easier and more flexible.

And we come again to Cygwin where those unix tools are provided.

Before I finish, I guess I should say that setting both clients up for POP access seems to be reasonably straightforward (haven't done it yet), and with additional SSL binaries even IMAP has been achieved by a few people (though trying to get their incantations to work for me has been elusive).  Having said that, I'd point out that POP is as far as you can go with no additional binaries.  It just seems that Emacs is a whole lot happier if an MTA is used to transfer the mail, rather than Emacs freezing while it does that job.  Having Emacs lock up seems to defeat the purpose of ease of use.

later .....................

Finding Emacs - Orgmode, Outlines and Ascii Export

I mentioned earlier that I came to Emacs because I thought Orgmode would be a great thing to use.  Cross platform, readable format and a powerful tool once it has been learnt.  To make the learning curve a little flatter, here is how to do a simple outline in Orgmode, and to export it to a text file.

I've already pointed to the link that shows the few lines that are needed to be inserted in the " init.el " file, so all we need to do is to open a file and start.  I name all my orgmode files with the suffix " .org " - makes it easier to recognise, and Emacs will know that we want orgmode.  The first lines of an orgmode file I open are:

-*- mode:org ; mode:visual-line -*-
#+STARTUP: indent
#+OPTIONS: H:4


The lines re-confirm it is an orgmode file, and ensure the system is set up for wordwrap the way I like it.  I tell orgmode I want the headings arranged in a more readable format, and that when I export, I want down to four levels of headings (the default is three).

To start a level one heading, type something like:

* heading one

  • If you now type M-RETURN, you will get another level one heading below it ready to name.
  • Once you have your second level one heading, type M-RIGHTARROW - you now have a level two heading. Try M-LEFTARROW now.
  • Note the coloured headings - a different colour for each heading level
  • With two level one headings, experiment with M-DOWNARROW and M-UPARROW and see that the headings (and all their sub-trees) swap around
  • If you type RETURN, then you can simply start typing text.

Want to do a list?  Try this:

list header
- list item

at the end of the " - list item " line, M-RETURN and there is the next item started for you.

Exporting

Want to export as a plain, formatted text file?
Org>Export/Publish..  menu item

A new buffer appears in a split (is that a window or a frame, he thinks)  and type   "  a  " from the list of possibilities, and the export is confirmed in the mini-buffer at the bottom.  It appears as a " .txt " file in the same directory as the " .org " file you were using.

Here is what I got:


         -*- mode:org ; mode:visual-line -*-
         ========================

Author:  
Date: 2010-12-19 11:26:27



Table of Contents
=================
1 heading one
2 Another heading


1 heading one
^^^^^^^^^^^^^^

2 Another heading
^^^^^^^^^^^^^^^^^^^
list header:
- list item
-


Of course, if you want to avoid the the first line starting with -*- , there are several ways you can easily do this, but I won't go into that now.  One final note, when you export to HTML, it follows the HTML logic, so that if you have an informal list like so:

item one
item two
item three

Then they will appear in the HTML export as:

item oneitem twoitem three



later ................

Update 12 jan11:

You can comment out the first line "-*- mode:org ; mode:visual-line -*-" to be:

# -*- mode:org ; mode:visual-line -*-

and it will not appear in the export and it will still give you the presets for your file.

Saturday, December 18, 2010

Finding Emacs - W3m and Installation Routines

I keep reading how people use the W3m pager to view the web from within Emacs and I just had to give it a go.  Believe me when I say that it isn't as easy as you might think to set up Emacs for web browsing, certainly not in Windows.  W3m doesn't exist for Windows as a separate easily downloadable binary for a start.

But wait ....... there is Cygwin.

I talked a bit about Cygwin in my last post and it turns out that for installing extensions to Emacs in Windows, that Cygwin is turning out to be the most sensible course of action.  There are exceptions of course, but in my experience there always are.

So, for that "text" web experience, start here ..

Start by downloading and installing cygwin.  It comes as a single file called "setup.exe" which will then ask which internet repository you wish to use, then download the available installation menu for you.  If you are really keen, you can install X and have some graphical Unix tools on your desktop, however we just want to download the " w3m " browser which you can easily find by using the search function included.

Next, Put the path to the " C:\cygwin\bin " directory in your .. er .. PATH environment variable.  The beauty of this is that it will allow you to use other utilities without adding more and more to the PATH, and save you some fiddling to boot.

OK, we have the easy bit done.  Now we have to download and install the emacs-w3m extension.  The extension itself is available from here and at the time of writing the most recent release was 1.4.4 from 2005.
Unpack the archive and place the resulting folder in your " .emacs.d " directory.

Installation.  This needs a bit of thought and is not entirely obvious.  On Windows, we cannot use the " make " utility so there is an alternative provided.

First, change into the emacs-w3m directory that you just unpacked, from in Emacs by using the menu FILE>Open Directory command.

Next, issue the installation command for non-Unix systems given in the web page by using the TOOLS>Shell Command menu selection.

emacs -batch -q -no-site-file -l w3mhack.el NONE -f w3mhack-nonunix-install

We are almost there.  All we need is to make changes to our " init.el " file and it is finished.  Without a thoughtful hack mentioned here, this version of w3m won't work in Emacs 23.

;; w3m
(setq load-path (cons "~/.emacs.d/emacs-w3m-1.4.4" load-path))
(setq load-path (cons "~/.emacs.d/emacs-w3m-1.4.4/attic" load-path))
(require 'w3m-e21)
(provide 'w3m-e23)
(require 'w3m-load)
 Now, restart to re-initialise your PATH variable, hold your breath and start Emacs then:

M-x w3m

and ..... ?

 

later ..............


It worked for me ... your mileage may vary ......

Finding Emacs - Cygwin

Whilst I've been investigating what I can do with Emacs, I've mostly been using a Windows XP machine - not for any reason other than it was there after I'd had to drag it out of a back room into my study to use it for a set of electronic manuals I needed to study.  Why does everyone need to write such things that are dependent on Windows?  Cross platform manuals seem such a logical thing to do.

However back to the story.  I'd started on Emacs with Org-mode for my notes and then I found myself with time on my hands and decided to expand on the Emacs and learn what else I could use it for.  I have rapidly found that the Unix heritage shows through, but I've been resisting and trying to find solutions using purely Windows binaries.  I have finally had to admit that such a course is really too complex and by far the simplest course of action is to use cygwin.


Cygwin

Simply put, Cygwin is a large subset of the Unix system compiled for Windows.  That is oversimplifying it, but essentially correct.  You can effectively use Unix tools in the Windows environment, and since there are no native binaries for a number of utilities required for Emacs extensions (or binaries that need careful searching for) it makes sense just to use Cygwin and have one entry into the PATH variable.

Of course the other advantage of Cygwin is that it provides a gentler introduction to the Unix way for people and who knows, they may even see the sense of a change and abandon the dangers of a computing monoculture.


later ....


Disclaimer:  I'm happy to tell you what I've found if you take responsibility for your actions.

Friday, December 17, 2010

Finding Emacs - Gnus (news)

The Emacs documentation says that Gnus can be used for Newsgroup reading and Email.  It all seems a bit opaque as you start, however, when all else fails, read the documentation.  Even though most manuals are more "reference manuals" than "how-to" manuals, there are a couple of things straight up that let you get connected to reading newsgroups.

First, you have the option of placing your gnus initialisation instructions in either " init.el " or in " ~/.gnus.el ".  Placing them in the gnus.el file means that they are removed from the init.el and they are only read when gnus is started.  So all that is needed is to place these lines in whichever of the two files you have chosen:

;; Gnus
(setq gnus-select-method '(nntp "news.somewhere.com"))

I note in one tutorial I found that there is also an option to place the nntp port in the server instruction, however I didn't see it mentioned in the reference manual.

Three ways you can start Gnus:

  • Menu
  • M-x gnus or 
  • M-x gnus-other-frame

Once you start, you will be presented with a restricted subset of the available newsgroups in the current buffer.  To retrieve the full alphabetically sorted list

AA

Now you can move the cursor round and enter and read whichever groups you fancy.  With the cursor over a group you want to subscribe to

u

Now, Groups>Listing>List unread subscribed groups     ( or   l  - small L)

I haven't been too intent on learning Gnus in depth, since newsgroups are not particularly interesting to me at the moment, however I did check that highlighted articles (even multiple highlighted articles) with binary attachments can be decoded and saved with:

Article>MIME>Extract all parts

Searching Google with " Gnus Tutorial " was quite productive and these are a couple I found:


This is enough to get started, and a little more dilligence will show in more detail how to best use this tool.  Like everything in Emacs, the tools overlap, so learn one and parts are of benefit elsewhere.  With one tool you know well such as Emacs, you can take it anywhere with you and not have to start afresh on a different system.


Later ............

Wednesday, December 15, 2010

Finding Emacs - Add an External Mode, Predictive, Byte Compiling

I've tried to keep these posts short to illustrate one point that will be easy to find (for me as well when I need to remember) however I'm combining three things here because they dovetail so well and really depend upon each other.


Add an External Mode

Modes in Emacs are really collections of Emacs Lisp files collected together in a directory.  You tell Emacs about them by referring to them in the " init.el " file.

This is where I believe that using the standard Emacs intitialisation structure even for Aquamacs is an excellent idea.  Use the " .emacs.d " initialisation directory and place the external modes you are adding into this directory. That way it is all neatly packed together.


Predictive


I first read about predictive on this page.  It gives a good introduction to what it is all about and how to do Byte compiling of Lisp files on a Windows machine.  Normally, when you add an external mode, they give a " makefile " which is not much good to you in Windows, however you can simply do a manual version of it using Byte Compiling using Dired.  I will repeat a couple of points on my linked page, just in case it becomes broken at some stage in the future, which will not be much good to me if I've forgotten it and am trying to piece things together again.

So, obtain Predictive from here.  I used a Windows archive utility (check freewarefiles) to unpack the " tar.gz " file into a folder called " predictive ".  Place this folder in the " .emacs.d " directory.

These are the lines I put in my " init.el " file to point to the directory.

;; Predictive
(setq load-path (cons "~/.emacs.d/predictive" load-path))
(autoload 'predictive-mode "predictive" "predictive" t)

You are all set now (after you restart Emacs to get the init.el file re-read), you can manually start predictive-mode by:

M-x predictive-mode (RETURN)

See my post about File Variables for an automagic way of starting it.

It now all works ....... errrr ........ sooorrrrttttt of.

It is sooo slooowwww it is almost unuseable.  To speed things up, we need to ...


Byte Compile Lisp Files

This is where that previous post on Dired comes in handy.  We can change to the appropriate directory, mark the files and then byte compile them from within Emacs.

C-x d ~/.emacs.d/predictive RET
% m \.el$ RET  
B                        
  • With the first line, we open Dired, changing to the predictive directory
  • The next line (starting with the % character) marks all the  " .el " files
  • Finally, the command " B " tells Emacs to start byte compiling all the marked files.  You will only have to reply " yes, or y " to confirm you want it to start.
The byte compilation will take some time, so don't worry, it will get there.  Once it is finished, restart Emacs and now you are on your way with a much faster and useable " predictive mode "


later .....

Finding Emacs - Mobileorg

 v 0.4
Oct 2011

But wait, there's more!

Orgmode has the ability to be read and manipulated on iphone / ipad / android through mobileorg.  Now to be strictly correct, there is a separate website for dealing with the android platform, however you get the idea.

There are several ways to synchronise between devices, but the method I use is through Dropbox.  Works great.

NOW ... if you use Emacs/Orgmode on Windows, you NEED to know this if you are going to use Mobileorg.  It is essential you download and install in your path the md5sum utility.  The webpage is here, and if you are uncertain which file to download, download the setup file.  The reason is that this file includes BOTH the executables AND the required dll files.  Don't forget to modify the PATH variable so that the system can find the md5sum executable.

And since there's nothing I can add that isn't a duplicate of the Mobileorg site ......



more later .......

Update 31 Dec 2010

With regard to the MD5sum program.  Rather than go through the complexity of the instructions above, download and install Cygwin, putting the cygwin\bin directory in your path.  Using the md5sum from cygwin allows you to simplify the PATH, since there are numberous cygwin binaries (w3m, gpg, gnutls etc)  that are useful for Emacs.

Additionally, the setup given in the Mobileorg page is as clear as mud.  I searched around a bit trying to remember how I set mine up and:

You can play around with the "setup" menu selection under Mobileorg in the Emacs menus, or .. use this example for additions to your init.el  .. obviously you need to modify to suit yourself:


;; Mobileorg
;; Set to the location of your Org files on your local system
(setq org-directory "~/org")
;; Set to the name of the file where new notes will be stored
(setq org-mobile-inbox-for-pull "~/org/newnotes.org")
;; Set to /MobileOrg.
(setq org-mobile-directory "~/Dropbox/MobileOrg")


(setq org-mobile-files (quote ("~/org/A380Notes.org")))



if you want all your org files to be pushed then:


(setq org-mobile-files (quote ("~/org")))


Then to manipulate in Emacs:
M-x org-mobile-push
and
M-x org-mobile-pull


I'm sure there are errors above - will work on it and refine the above later - I know how frustrating it can be trying to find these things out and thought I'd post what I have at the moment.

Update 9 Oct 2011

I spent the afternoon reviewing my MobileOrg setup on a Windows 7 machine. 

To use Emacs / Mobileorg on a Windows machine, you really do need some Unix tools.  Either use Cygwin, or install the GnuWin32 tools from Sourceforge.  (I won't supply the links - google will provide).  You will need "coreutils" (and the "make" utility if you are going to compile any lisp files).  Make sure the GnuWin32 "bin" directory is in your path. (coreutils contains the "md5sum" utility).

Whilst the instructions on the MobileOrg website are correct, I found there were a few "gotchas" that need explaining. 
  • Dropbox has changed its location on a Windows Machine.  It is now just "Dropbox" rather than "My Dropbox".  Took me a while to work out why things were not working when Mobileorg on Emacs said they were.
  • The filename for collecting notes from the mobile device can be anything you like.
  • The "index.org" file format is described correctly, however be particularly careful of the syntax for the link. ... " [[file:first.org][An Org file I like]] " .. as opposed to the http format.
I tried using "Box.net" as a WEBDAV connection, however the link format they use is incompatible with Mobileorg.

The only other thing I can think of  to note is that the file for notes from the mobile device will probably get confused if you have multiple devices collecting notes, such as an ipad AND an iphone.


Later......

Finding Emacs - Orgmode

A suitable sub-title for this post would be:

Just how deep does this rabbit hole go?

I couldn't possibly show how to use orgmode in a blog posting.  It is far more profitable to visit the orgmode website and view the youtube videos and tutorials.

Instructions as to the text to insert into your " init.el " file are in the activation section of the orgmode manual.

What I can do though is to give you an overview and just a hint of what you are able to achieve using orgmode.  Orgmode has been likened to being an "Office suite" for Emacs and the comparison is not too far from the truth.  In its basic iteration, orgmode seems to be an outliner, which is where it started life however it also has to-do list capabilities, agenda views, the ability to produce a nicely formatted table and to run spreadsheets and formulas within a text orgmode document.  Then there are the export capabilities - we start with exporting your document as an ascii text document whereupon you see a nicely formatted document with a table of contents at the front.  Then you can export to HTML if you wish or make a beautifully indexed PDF or Latex document.

I suppose I should tell you that Orgmode is included in Emacs.

Finally, these are first lines I put into an orgmode file:


-*- mode:org ; mode:visual-line; mode:predictive -*-
#+STARTUP: indent
#+OPTIONS: H:4

The first line I have discussed previously, however the next two lines are specific orgmode instructions that you can read more about in the manual.  The first tells orgmode to indent sub-headings so as to make the document more readable, and the second tells orgmode to export as separate headings down to 4 levels of headings.  If you have, say 5 levels, they will be exported, but not placed as a heading, just text.

I leave the rest to your curiosity.


more later ...........

Finding Emacs - Customising Automatically per File

psst ..... listen verryy carefully ... I shall say this only once ...

The secret search term is  "emacs file variables"

To set modes and variables for an individual file, place a line such as that below on the FIRST line of the file.

-*- mode:org ; mode:visual-line; mode:predictive -*-

What this line means is to set the file for orgmode, word-wrap and predictive text typing.  Saves having to enter keystrokes to set the environment how you want.

There is an alternative syntax that can be used at the end of the file, however I'll leave you to read the reference for that.

Update 17Jan11

Placing the particular comment character for the source file you are using in front of the customisation line will render it invisible in the output, so for orgmode, it would look like this:

# -*- mode:org ; mode:visual-line; mode:predictive -*-

more later ...



I'll leave you to spot the errors ..... :)

Finding Emacs - to Word Wrap or to Truncate

When I started using Emacs, which was only a few months ago when I discovered org-mode, I spent a little bit of time working out how to organise the word-wrap of text files.

The menu selection "Options>Line Wrapping in this Buffer" has the answer.
  • Truncate lines simply means that the line will continue until you terminate the line and you will only see a small amount of it in the window.
  • Visual Line Mode is what we typically think of word wrapping in the window.
  • Wrap at Window Edge is another line wrap mode which appears to work, however I prefer the previous two modes as I'm using the editor.
Remember, you will probably have to set the wrap manually.

.... unless .... you have learnt to set the modes and variables per file.