Thursday, July 28, 2011

SVN: delete folder and clean up the mess

To delete a folder:
student-107-dun20-186:src angelazhu$ svn delete --force genedup/

Then when you commit, you might get:
student-107-dun20-186:src angelazhu$ svn commitDeleting       src/genedup
svn: Commit failed (details follow):
svn: Item '/trunk/EvoGeneDup/src/genedup' is out of date
svn: Your commit message was left in a temporary file:
svn:    '/Users/angelazhu/svn/EvoGeneDup/svn-commit.tmp'
student-107-dun20-186:src angelazhu$ svn up genedup/
   C genedup
At revision 223.
Summary of conflicts:
  Tree conflicts: 1
student-107-dun20-186:src angelazhu$ svn commit
svn: Commit failed (details follow):
svn: Aborting commit: '/Users/angelazhu/svn/EvoGeneDup/src/genedup' remains in conflict

Now try:
student-107-dun20-186:src angelazhu$ svn resolved genedup/
Resolved conflicted state of 'genedup'
student-107-dun20-186:src angelazhu$ svn ci genedup/ -m "obsolete"


And you will get:
svn: The log message is a pathname (was -F intended?); use '--force-log' to override

Try:
student-107-dun20-186:src angelazhu$ svn ci genedup/ --force-log -m "obsolete"

Done!
Deleting       genedup
Committed revision 224.

Friday, July 22, 2011

Emacs encoding and load-path

(1) Emacs encoding:
This is definitely the king of obscure Emacs key combinations. To change the encoding of an existing file, use C-x RET f RET.
Tab-completion works for the encoding. “utf-8″ is the one I use most often, but “unix” and “dos” are also useful.
To make Emacs open files in UTF-8 per default, use the following snippet in .emacs:
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8) 
 
(2) Emacs load-path
The load-path is just a list of places where Emacs looks when it needs
to load something, not a list of places where it loads everything when
you didn't tell it to.  Usually, you set up things by saying (autoload
'foo-mode "foo") in the .emacs file.  Then when you call the function
named foo-mode for the first time, emacs looks for "foo.el" in the
load-path.
Calling the function is done either by typing "M-x foo-mode" or typing
a key combination that you set to 'foo-mode by define-key or
set-local-key (see those functions' docs).
So try to find out the function you're supposed to invoke, find out
the name of the file containing its definition, and write an autoload
entry.  Most packages will usually say either on its download page or
in the beginning comments of the main file what autoload command to
add to .emacs.
If this still doesn't work, the last resort is to say (load "foo") in
your .emacs; then every time Emacs starts up, it will look for foo.el
in the load-path and load it.  This slows down startup though, so you
should do it sparingly.