Mike Steder  committed fac3c34

Added flymake cursor

  • Participants
  • Parent commits 47e5c11
  • Branches default

Comments (0)

Files changed (5)

File emacs

Binary file modified.

File emacs.d/custom.el

   ;; If you edit it by hand, you could mess it up, so be careful.
   ;; Your init file should contain only one such instance.
   ;; If there is more than one, they won't work right.
- '(c-default-style (quote ((java-mode . "java") (awk-mode . "awk") (other . "stroustrup"))))
  '(column-number-mode t)
  '(display-time-mode t)
- '(midnight-mode t nil (midnight))
- '(org-agenda-files (quote ("~/bugs/")))
  '(show-paren-mode t)
- '(size-indication-mode t)
- '(uniquify-buffer-name-style (\` reverse) nil (uniquify)))
+ '(size-indication-mode t))
   ;; custom-set-faces was added by Custom.

File emacs.d/flymake-cursor.el

+;; -*- emacs-lisp -*-
+;; License: Gnu Public License
+;; Additional functionality that makes flymake error messages appear
+;; in the minibuffer when point is on a line containing a flymake
+;; error. This saves having to mouse over the error, which is a
+;; keyboard user's annoyance
+;;flymake-ler(file line type text &optional full-file)
+(defun show-fly-err-at-point ()
+  "If the cursor is sitting on a flymake error, display the
+message in the minibuffer"
+  (interactive)
+  (let ((line-no (line-number-at-pos)))
+    (dolist (elem flymake-err-info)
+      (if (eq (car elem) line-no)
+	  (let ((err (car (second elem))))
+	    (message "%s" (fly-pyflake-determine-message err)))))))
+(defun fly-pyflake-determine-message (err)
+  "pyflake is flakey if it has compile problems, this adjusts the
+message to display, so there is one ;)"
+  (cond ((not (or (eq major-mode 'Python) (eq major-mode 'python-mode) t)))
+	((null (flymake-ler-file err))
+	 ;; normal message do your thing
+	 (flymake-ler-text err))
+	(t ;; could not compile err
+	 (format "compile error, problem on line %s" (flymake-ler-line err)))))
+(defadvice flymake-goto-next-error (after display-message activate compile)
+  "Display the error in the mini-buffer rather than having to mouse over it"
+  (show-fly-err-at-point))
+(defadvice flymake-goto-prev-error (after display-message activate compile)
+  "Display the error in the mini-buffer rather than having to mouse over it"
+  (show-fly-err-at-point))
+(defadvice flymake-mode (before post-command-stuff activate compile)
+  "Add functionality to the post command hook so that if the
+cursor is sitting on a flymake error the error information is
+displayed in the minibuffer (rather than having to mouse over
+  (set (make-local-variable 'post-command-hook)
+       (cons 'show-fly-err-at-point post-command-hook))) 

File emacs.d/look_and_feel.el

 (if window-system
       (color-theme-initialize) ; If gui window, load this theme
-      ( color-theme-tango )))
-;  ( color-theme-euphoria )); If terminal, load this theme
+      ( color-theme-tango ))
+  (color-theme-euphoria); If terminal, load this theme
+  )
 ;; Show the time on the status bar.

File emacs.d/mspython.el

 ;; python-mode:
 ;(setq load-path (cons "/usr/share/emacs/site-lisp" load-path))
-(autoload 'python-mode "python-mode" "Python editing mode." t)
+;(autoload 'python-mode "python-mode" "Python editing mode." t)
 ;(setq auto-mode-alist
 ;      (cons '("\\.py$" . python-mode) auto-mode-alist))
 ;(pymacs-load "bikeemacs" "brm-")
+;;; Get python documentation 
+;; get help on a symbol: C-c C-f
+;(add-hook 'python-mode-hook
+;          '(lambda () (eldoc-mode 1)) t)
 (add-to-list 'auto-mode-alist '("\\.tap\\'" . python-mode))
 (add-to-list 'auto-mode-alist '("\\.tac\\'" . python-mode))
 (add-hook 'find-file-hook 'flymake-find-file-hook)
 ;; run pyflakes(instead of pychecker) manually with C-c C-w:
+;; python-mode.el from python
 (setq py-pychecker-command "pyflakes")
 (setq py-pychecker-command-args "")
+;; python.el from emacs
+(setq python-check-command "pyflakes")
 (require 'mstest)