Monday, May 11, 2009

Config for nXML-mode in Emacs 23.1


(require 'rng-loc)
(setq rng-schema-locating-files
(list* "schemas.xml"
(u:in-elisp-dir "user-nxml-schema/schemas.xml")
(remove "schemas.xml" rng-schema-locating-files-default)))

(setq auto-mode-alist
(cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\|plist\\|keylayout\\|sdef\\)\\'" . nxml-mode)
auto-mode-alist))
;;
(setq magic-mode-alist
(remove-if '(lambda (x) (member x '(xml-mode html-mode sgml-mode)))
magic-mode-alist :key 'cdr))

Monday, March 16, 2009

Breakpoints to put in .gdbinit #2

To catch NSException properly put:

fb +[NSException exceptionWithName:reason:userInfo:]

When Xcode says: "Could not find file … Perhaps it was moved or deleted?"

You need to remove Xcode preferences (.plists) in your ~/Library folder to fix that.

Thursday, January 15, 2009

Don't write .DS_Store files on remote machines

To configure a Mac OS X user account so that .DS_Store files are not created when interacting with a remote file server using the Finder:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true


(Got from here)

Wednesday, January 14, 2009

Breakpoints to put in .gdbinit

Here is a list of break points to put in ~/.gdbinit that are really helpful in debugging memory problems:

fb -[NSException raise]
fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]

#define NSZombies
# this will give you help messages. Set to NO to turn them off.
set env MallocHelp=YES
# might also be set in launch arguments.
set env NSZombieEnabled=YES
set env NSDeallocateZombies=NO
set env MallocCheckHeapEach=100000
set env MallocCheckHeapStart=100000
set env MallocScribble=YES
set env MallocGuardEdges=YES
set env MallocCheckHeapAbort=1

set env CFZombie 5

fb -[_NSZombie init]
fb -[_NSZombie retainCount]
fb -[_NSZombie retain]
fb -[_NSZombie release]
fb -[_NSZombie autorelease]
fb -[_NSZombie methodSignatureForSelector:]
fb -[_NSZombie respondsToSelector:]
fb -[_NSZombie forwardInvocation:]
fb -[_NSZombie class]
fb -[_NSZombie dealloc]

fb szone_error


(Got from www.cocoadev.com )