Advertisement
SoftTimur

Untitled

Apr 9th, 2016
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.62 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.  
  18. (global-set-key "\C-x\C-m" 'compile)
  19.  
  20. ;; http://emacswiki.org/emacs/ModeCompile
  21. ;; Helper for compilation. Close the compilation window if
  22.   ;; there was no error at all.
  23.   (defun compilation-exit-autoclose (status code msg)
  24.     ;; If M-x compile exists with a 0
  25.     (when (and (eq status 'exit) (zerop code))
  26.       ;; then bury the *compilation* buffer, so that C-x b doesn't go there
  27.       (bury-buffer)
  28.       ;; and delete the *compilation* window
  29.       ;; (run-at-time 0.5 nil 'delete-window (get-buffer-window (get-buffer "*compilation*"))))
  30.       (delete-window (get-buffer-window (get-buffer "*compilation*"))))
  31.     ;; Always return the anticipated result of compilation-exit-message-function
  32.     (cons msg code))
  33.   ;; Specify my function (maybe I should have done a lambda function)
  34. (setq compilation-exit-message-function 'compilation-exit-autoclose)
  35.  
  36. (custom-set-variables
  37.  ;; custom-set-variables was added by Custom.
  38.  ;; If you edit it by hand, you could mess it up, so be careful.
  39.  ;; Your init file should contain only one such instance.
  40.  ;; If there is more than one, they won't work right.
  41.  '(compilation-always-kill t)
  42.  '(compilation-ask-about-save nil)
  43.  '(compilation-context-lines 0)
  44.  '(compilation-scroll-output t)
  45.  '(compilation-window-height 21)
  46.  '(ns-alternate-modifier (quote meta))
  47.  '(ns-right-alternate-modifier (quote none))
  48.  '(tool-bar-mode nil))
  49. (custom-set-faces
  50.  ;; custom-set-faces was added by Custom.
  51.  ;; If you edit it by hand, you could mess it up, so be careful.
  52.  ;; Your init file should contain only one such instance.
  53.  ;; If there is more than one, they won't work right.
  54.  '(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")))))
  55.  
  56. ;; use tuareg-mode https://github.com/ocaml/tuareg
  57. (load "/Users/softtimur/.opam/system/share/emacs/site-lisp/tuareg-site-file")
  58.  
  59. ;; use ocp-indent https://www.typerex.org/ocp-indent.html
  60. (add-to-list 'load-path "/Users/softtimur/.opam/system/share/emacs/site-lisp")
  61. (require 'ocp-indent)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement