;; ;; This is an excerpt from RHL's .emacs file. ;; ;; It is provided purely for your convenience and amusement, and ;; is not supported. ;; ;; Tell emacs where to find skyserver mode ;; (setq load-path (append (list "/your/site/lisp/directory") load-path)) (autoload 'skyserver-mode "skyserver" "Interact with the SDSS skyserver" t) ;; ;; Modify sql mode to be more to my liking ;; (add-hook 'sql-mode-hook '(lambda () (skyserver-mode t) (setq case-fold-search t) (setq sql-indent-first-column-regexp ; remove -- from this list (concat "^\\s-*" (regexp-opt '( "select" "update" "insert" "delete" "union" "intersect" "from" "where" "into" "group" "having" "order" "set" "and" "or" "exists" "left" "join" "on" ) t) "\\(\\b\\|\\s-\\)")) (setq sql-indent-offset 3) (setq sql-indent-maybe-tab nil) (skyserver-font-lock-add-keywords) (font-lock-mode))) ;; ;; Here's a place to bend skyserver mode to your whims, but I actually ;; recommend that you use customize (from the skyserver menu) instead. ;; (add-hook 'skyserver-hook '(lambda () )) ;; ;; Indent sql code. Requires that you didn't delete sql-indent.el ;; (eval-after-load "sql" '(load-library "sql-indent")) ;; ;; Here's a procedure that I use to workaround problems in at least ;; some versions of mozilla ;; (defun skyserver-display-url-image (url &optional file display) "Display an image returned from the URL. If FILE is true, save the image to that file and then display it; if FILE is t, save it to a file named after the object's ID. DISPLAY is the image display program to use, by default \"display\" If the function returns nil, skyserver.el will attempt to display it for you. " (interactive "sURL: ") (if (not (or (string-match "get/\\(specById\\).asp\\?id=\\([0-9]+\\)$" url) (string-match "\\(SdssCutout\\).*\\(ra=[^&]+&dec=[^&]+\\)" url) (string-match "\\(frameById\\).*\\(id=[^&]+&zoom=[^&]+\\)" url) )) nil (setq url (concat "'" url "'")) (let* ( (id (match-string 2 url)) (file (cond ((or (not file) (stringp file)) file) ((equal (match-string 1) "specById") (concat "spec-" id ".gif")) ((equal (match-string 1) "SdssCutout") (concat "cutout-" id ".jpg")) )) (buffer "*skyServer-img*") (args (list "get-spec" buffer skyserver-send-url url)) ) (if (not display) (setq display "display")) (setq args (append args (if file (list ">" file ";" display "-geometry" "+1+1" file) (list "|" display "-geometry" "+1+1" "-")))) (apply 'start-process-shell-command args) ) t))