SoftTimur

Untitled

May 27th, 2016
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.99 KB | None | 0 0
  1. ;; http://stackoverflow.com/a/18354274/702977
  2. (setq ns-pop-up-frames nil)
  3.  
  4. (defun goto-last-edit-point ()
  5.   "Go to the last point where editing occurred."
  6.   (interactive)
  7.   (let ((undos buffer-undo-list))
  8.     (when (listp undos)
  9.       (while (and undos
  10.           (let ((pos (or (cdr-safe (car undos))
  11.                  (car undos))))
  12.             (not (and (integerp pos)
  13.                   (goto-char (abs pos))))))
  14.     (setq undos (cdr undos))))))
  15. (global-set-key (kbd "C-q") 'goto-last-edit-point)
  16.  
  17. (global-set-key "\C-x\C-m" 'compile)
  18.  
  19. ;; http://emacswiki.org/emacs/ModeCompile
  20. ;; Helper for compilation. Close the compilation window if
  21.   ;; there was no error at all.
  22.   (defun compilation-exit-autoclose (status code msg)
  23.     ;; If M-x compile exists with a 0
  24.     (when (and (eq status 'exit) (zerop code))
  25.       ;; then bury the *compilation* buffer, so that C-x b doesn't go there
  26.       (bury-buffer)
  27.       ;; and delete the *compilation* window
  28.       ;; (run-at-time 0.5 nil 'delete-window (get-buffer-window (get-buffer "*compilation*"))))
  29.       (delete-window (get-buffer-window (get-buffer "*compilation*"))))
  30.     ;; Always return the anticipated result of compilation-exit-message-function
  31.     (cons msg code))
  32.   ;; Specify my function (maybe I should have done a lambda function)
  33. (setq compilation-exit-message-function 'compilation-exit-autoclose)
  34.  
  35. (custom-set-variables
  36.  ;; custom-set-variables was added by Custom.
  37.  ;; If you edit it by hand, you could mess it up, so be careful.
  38.  ;; Your init file should contain only one such instance.
  39.  ;; If there is more than one, they won't work right.
  40.  '(compilation-always-kill t)
  41.  '(compilation-ask-about-save nil)
  42.  '(compilation-auto-jump-to-first-error 1)
  43.  '(compilation-skip-threshold 2)
  44.  '(compilation-context-lines 0)
  45.  '(compilation-scroll-output t)
  46.  '(compilation-window-height 21)
  47.  '(ns-alternate-modifier (quote meta))
  48.  '(ns-right-alternate-modifier (quote none))
  49.  '(safe-local-variable-values
  50.    (quote
  51.     ((eval setq default-directory
  52.        (locate-dominating-file buffer-file-name ".dir-locals.el")))))
  53.  '(tool-bar-mode nil))
  54. (custom-set-faces
  55.  ;; custom-set-faces was added by Custom.
  56.  ;; If you edit it by hand, you could mess it up, so be careful.
  57.  ;; Your init file should contain only one such instance.
  58.  ;; If there is more than one, they won't work right.
  59.  '(default ((t (:inherit nil :stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 160 :width normal :foundry "nil" :family "Menlo")))))
  60.  
  61. ;; use tuareg-mode https://github.com/ocaml/tuareg
  62. ;; (load "/Users/softtimur/.opam/system/share/emacs/site-lisp/tuareg-site-file")
  63. (load "/Users/softtimur/.opam/4.02.3/share/emacs/site-lisp/tuareg-site-file")
  64.  
  65. ;; use ocp-indent https://www.typerex.org/ocp-indent.html
  66. ;; (add-to-list 'load-path "/Users/softtimur/.opam/system/share/emacs/site-lisp")
  67. (add-to-list 'load-path "/Users/softtimur/.opam/4.02.3/share/emacs/site-lisp")
  68. (require 'ocp-indent)
Advertisement
Add Comment
Please, Sign In to add comment