This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun is-argument-list-delimiter (chr) | |
| (or (= chr ?\,) (= chr ?\)) (= chr ?\=))) | |
| (defun extract-c-arguments () | |
| (interactive) | |
| (let | |
| ((open-brace | |
| (progn (beginning-of-line) | |
| (search-forward "(") | |
| (backward-char) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun make-some-files-read-only () | |
| "when file opened is of a certain mode, make it read only" | |
| (when (memq major-mode '(c++-mode python-mode c-mode actionscript-mode unrealscript-mode lisp-mode)) | |
| (toggle-read-only 1))) | |
| (add-hook 'find-file-hook 'make-some-files-read-only) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; assume filename is same as classname | |
| (defun get-class-name () | |
| (file-name-nondirectory (file-name-sans-extension buffer-file-name))) | |
| ;; insert it interactively | |
| (defun insert-class-name () | |
| (interactive) | |
| (insert (get-class-name))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; a convienence function that lets us switch between source/header files in a project | |
| (defun buffer-other-eproject-files () | |
| (interactive) | |
| (let* | |
| ((buffer-file (file-name-nondirectory (buffer-file-name))) | |
| (other-buffer-files | |
| (delq nil | |
| (mapcar (lambda (x) (and | |
| (equal (file-name-nondirectory (file-name-sans-extension x)) (file-name-sans-extension buffer-file)) | |
| (not (equal (file-name-nondirectory x) buffer-file)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (ARGUMENTS.get("SYNTAX",0) == 0): | |
| env.Alias("all", env["AQUA_LIBRARIES"]) | |
| env.Default("all") | |
| else: | |
| env["CCFLAGS"] = [ "-fsyntax-only"] + env["CCFLAGS"] | |
| object_file = COMMAND_LINE_TARGETS[0] | |
| cpp_file = os.path.splitext(object_file)[0] + ".cpp" | |
| env.Default(env.Command( object_file, cpp_file, | |
| "$CC $CFLAGS $CCFLAGS $_CCCOMCOM " + cpp_file)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; generic Emacs utility | |
| ;;; ------------------------------------------------------------------ | |
| (defun add-subdirs-to-load-path (dir) | |
| (let ((default-directory (concat dir "/"))) | |
| (normal-top-level-add-subdirs-to-load-path))) | |
| ;;; basic load-path setup | |
| ;;; ------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct | |
| { | |
| unsigned code; | |
| } class; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defparameter *x* 45) | |
| (defparameter *y* 20) | |
| (defparameter *running* t) | |
| (defun main () | |
| (tcod:console-init-root 80 50 :title "Libtcod Lisp Tutorial" :fullscreen? nil :renderer :renderer-sdl) | |
| (loop | |
| while *running* | |
| do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defpackage #:trivial-gui | |
| (:use #:cl)) | |
| (in-package #:trivial-gui) | |
| (defmethod glop:on-key (window pressed keycode keysym text) | |
| (format t "Key ~:[released~;pressed~]: ~D (~S ~S)~%" pressed keycode keysym text) | |
| (format t "Key pressed: ~S~%" (glop:key-pressed keycode)) | |
| (when (and (not pressed) (eq keysym :escape)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import getopt | |
| import os | |
| import os.path | |
| import subprocess | |
| import ConfigParser | |
| # Example config | |
| # [Global] |