Posted By

kmc on 05/17/07


Tagged


Versions (?)

.emacs


 / Published in: Lisp
 

  1. ;;;
  2. ;;; Emacs initialization file
  3. ;;;
  4. ;;; Kevin Christen
  5. ;;;
  6.  
  7. ;;;
  8. ;;; General initialization
  9. ;;;
  10. (column-number-mode 1)
  11. (tool-bar-mode -1)
  12. (put 'eval-expression 'disabled nil)
  13. (put 'narrow-to-region 'disabled nil)
  14. (setq calendar-latitude 32.8)
  15. (setq calendar-longitude -96.8)
  16. (setq calendar-location-name "Dallas, TX")
  17. (setq confirm-kill-emacs (function yes-or-no-p))
  18. (setq default-fill-column 75)
  19. (setq default-major-mode 'text-mode)
  20. (setq dired-chmod-program "chmod")
  21. (setq-default indent-tabs-mode nil)
  22. (setq inhibit-startup-message t)
  23. (setq kill-whole-line t)
  24. (setq next-line-add-newlines nil)
  25. (setq site-lisp-dir (concat (getenv "EMACS_DIR") "/site-lisp"))
  26. (setq user-full-name "Kevin Christen")
  27. (setq user-mail-address "[email protected]")
  28. (setq visible-bell t)
  29.  
  30. ;;;
  31. ;;; Things that depend on the OS
  32. ;;;
  33. (cond
  34. ;; Linux
  35. ((string-equal system-type "gnu/linux")
  36. (set-default-font "10x20")
  37. (require 'gnuserv-compat))
  38.  
  39. ;; Windows
  40. ((string-equal system-type "windows-nt")
  41. (set-default-font
  42. ; "-raster-ProFontWindows-normal-r-normal-normal-23-172-96-96-c-*-iso10646-1"
  43. "-raster-System-bold-r-normal-normal-13-97-96-96-p-*-iso10646-1")
  44. ;; w32-print setup. Got w32-print.el from Emacs on NT home page.
  45. (setq-default
  46. w32-print-enable-keymappings nil
  47. w32-print-gs-command "d:/bin/gstools/gs5.50/gswin32c.exe"
  48. w32-print-gs-destination "//DFW/Konica 7050PS (5th Floor)"
  49. w32-print-gs-device "ljet4"
  50. w32-print-gs-device-dpi '300
  51. w32-print-gs-lib "d:/bin/gstools/gs5.50;d:/bin/gstools/gs5.50/fonts"
  52. w32-print-gs-path "d:/bin/gstools/gs5.50"
  53. w32-print-gs-version "4.03"
  54. w32-print-gs-view-path "d:/bin/gstools/gsview"
  55. w32-print-lpr-destination "//DFW/Konica 7050PS (5th Floor)"
  56. w32-print-ps-preview nil
  57. w32-print-use-faces nil)
  58. (load "w32-print" 'noerror 'nomessage)))
  59.  
  60. ;;;
  61. ;;; Things that depend on a GUI
  62. ;;;
  63. (cond (window-system
  64. (global-font-lock-mode t)
  65. (show-paren-mode 1)
  66. (require 'color-theme)
  67. (color-theme-initialize)
  68. (color-theme-blue-sea))
  69. (t (menu-bar-mode -1)))
  70.  
  71. ;;;
  72. ;;; Start the server
  73. ;;;
  74. (require 'server)
  75. (server-edit)
  76.  
  77. ;;;
  78. ;;; Global key assignments
  79. ;;;
  80. ;;; toggle comments on a region
  81. (global-set-key
  82. [f5]
  83. (function
  84. (lambda (point-min point-max)
  85. (interactive "r")
  86. (save-excursion
  87. (goto-char point-min)
  88. (skip-chars-forward " \t\n") ;skip whitespace
  89. (if (looking-at ;looking at beginning of comment?
  90. (substring comment-start 0
  91. ;strip trailing whitespace from comment-start
  92. (string-match "[ \t\n]*$" comment-start)))
  93. (uncomment-region point-min point-max)
  94. (comment-region point-min point-max))))))
  95.  
  96. (global-set-key [f6] 'indent-region)
  97. (global-set-key [f7] 'call-last-kbd-macro)
  98. ;;; run `compile' command with point at end of buffer
  99. (global-set-key
  100. [f8]
  101. (if (< emacs-major-version 20)
  102. (function
  103. (lambda ()
  104. (interactive)
  105. (call-interactively 'compile)
  106. (set-buffer "*compilation*")
  107. (set-window-point
  108. (get-buffer-window "*compilation*")
  109. (goto-char (point-max)))))
  110. 'compile))
  111. ;;; run `revert-buffer', with no confirmation
  112. (global-set-key
  113. [f9]
  114. (function (lambda () (interactive) (revert-buffer t t))))
  115.  
  116. ;;;
  117. ;;; Make bash work. From the NT emacs home page
  118. ;;;
  119. (setq shell-file-name "bash")
  120. (setq explicit-shell-file-name shell-file-name)
  121. ;; Run a dos shell if explicitly desired
  122. (defun dos-shell ()
  123. (interactive)
  124. (let ((explicit-shell-file-name "cmd"))
  125. (shell)))
  126.  
  127. ;;;
  128. ;;; visual-basic-mode, from the Emacs for Windows NT FAQ
  129. ;; (autoload 'visual-basic-mode "visual-basic-mode" "Visual Basic mode." t)
  130. ;; (setq auto-mode-alist (append '(("\\.\\(frm\\|bas\\|cls\\|ctl\\)$" .
  131. ;; visual-basic-mode)) auto-mode-alist))
  132. ;; (setq visual-basic-ide-pathname
  133. ;; "d:/Program Files/Microsoft Visual Studio/VB98/VB6.EXE")
  134. ;; (add-hook 'visual-basic-mode-hook
  135. ;; '(lambda () (setq visual-basic-mode-indent 4)))
  136.  
  137. ;; (autoload 'vbp-mode "visual-basic-mode" "VBP mode." t)
  138. ;; (setq auto-mode-alist (append '(("\\.\\(vbg\\|vbp\\)$" .
  139. ;; vbp-mode)) auto-mode-alist))
  140. ;; (autoload 'vbp-mode "vbp-mode" "VBP mode." t)
  141.  
  142. ;;;
  143. ;;; css-mode
  144. ;;;
  145. (autoload 'css-mode "css-mode")
  146. (setq cssm-indent-function #'cssm-c-style-indenter)
  147. (setq auto-mode-alist
  148. (cons '("\\.css\\'" . css-mode) auto-mode-alist))
  149.  
  150. ;;;
  151. ;;; cc-mode setup
  152. ;;;
  153. ;;; Got cc-mode v5.26 from http://www.python.org/emacs/cc-mode and
  154. ;;; installed it in d:/bin/emacs/site-lisp/cc-mode. Make sure it gets
  155. ;;; picked up.
  156. ;;;
  157. (setq load-path (cons (concat site-lisp-dir "/cc-mode") load-path))
  158. (setq auto-mode-alist (cons '("\\.g$" . java-mode) auto-mode-alist))
  159. (setq auto-mode-alist (cons '("\\.jad$" . java-mode) auto-mode-alist))
  160. ; The built in idl-mode is for OMG idl.
  161. (setq auto-mode-alist (cons '("\\.idl$" . c++-mode) auto-mode-alist))
  162. (setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))
  163.  
  164. (defconst medhost-c++-style
  165. '((c-basic-offset . 2)
  166. (c-cleanup-list . (defun-close-semi
  167. empty-defun-braces
  168. list-close-comma
  169. scope-operator))
  170. (c-comment-only-line-offset . (0 . 0))
  171. (c-hanging-braces-alist . ((substatement-open . (before after))))
  172. (c-hanging-colons-alist . ((access-label after)
  173. (case-label after)
  174. (inher-intro)
  175. (label after)
  176. (member-init-intro)))
  177. (c-offsets-alist . ((access-label . -)
  178. (arglist-close . 0)
  179. (block-open . 0)
  180. (inline-open . 0)
  181. (substatement-open . 0))))
  182. "MedHost's C and C++ formatting style")
  183.  
  184. (defconst kmc-c-style
  185. '((c-basic-offset . 3)
  186. (c-cleanup-list . (brace-else-brace
  187. defun-close-semi
  188. empty-defun-braces
  189. list-close-comma
  190. scope-operator))
  191. (c-comment-only-line-offset . (0 . 0))
  192. (c-hanging-braces-alist . ((block-open after)
  193. (block-close . (before after))
  194. (brace-list-open)
  195. (brace-list-close)
  196. (class-open after)
  197. (class-close . (before after))
  198. (defun-open . (before after))
  199. (defun-close . (before after))
  200. (inline-open after)
  201. (inline-close)
  202. (substatement-open after)))
  203. (c-hanging-colons-alist . ((access-label after)
  204. (case-label after)
  205. (inher-intro)
  206. (label after)
  207. (member-init-intro)))
  208. (c-offsets-alist . ((arglist-close . 0)
  209. (block-open . 0)
  210. (substatement-open . 0))))
  211. "KMC's C/C++ formatting style")
  212.  
  213. (add-hook
  214. 'c-mode-common-hook
  215. (function
  216. (lambda ()
  217. (c-add-style "MedHost's C and C++ formatting style" medhost-c++-style t)
  218. (c-toggle-auto-state 1)
  219. (c-toggle-hungry-state 1)
  220. (setq indent-tabs-mode nil)
  221. (turn-on-auto-fill))))
  222.  
  223. (defconst kmc-java-style
  224. '((c-basic-offset . 3)
  225. (c-cleanup-list . (defun-close-semi empty-defun-braces list-close-comma))
  226. (c-comment-only-line-offset . (0 . 0))
  227. (c-hanging-braces-alist . ((block-open after)
  228. (block-close . (before after))
  229. (brace-list-open)
  230. (brace-list-close)
  231. (class-open . (before after))
  232. (class-close . (before after))
  233. (defun-open after)
  234. (defun-close . (before after))
  235. (inline-open . (before after))
  236. (inline-close . (before after))
  237. (substatement-open after)))
  238. (c-hanging-colons-alist . ((access-label after)
  239. (case-label after)
  240. (inher-intro)
  241. (label after)
  242. (member-init-intro)))
  243. (c-offsets-alist . ((access-label . 0)
  244. (arglist-close . 0)
  245. (block-open . 0)
  246. (inline-open . 0)
  247. (substatement-open . 0))))
  248. "KMC's Java formatting style")
  249. (add-hook
  250. 'java-mode-hook
  251. (function
  252. (lambda ()
  253. (c-add-style "kmc-java" kmc-java-style t))))
  254.  
  255. ;;;
  256. ;;; emacs-lisp-mode setup
  257. ;;;
  258. (add-hook 'emacs-lisp-mode-hook '(lambda () (turn-on-auto-fill)))
  259.  
  260. ;;;
  261. ;;; html-mode and related file types
  262. ;;;
  263. (let ((tidy "~/elisp/tidy.el"))
  264. (if (file-exists-p tidy)
  265. (load tidy)))
  266. (setq auto-mode-alist (cons '("\\.jsp\\'" . html-mode) auto-mode-alist))
  267.  
  268. ;;;
  269. ;;; java-mode
  270. ;;;
  271. (add-hook 'java-mode-hook '(lambda ()
  272. (c-set-style "java")
  273. (setq c-basic-offset 3)))
  274.  
  275. ;;;
  276. ;;; JDEE
  277. ;;;
  278. ;(setq browse-url-new-window-p t)
  279. ;(require 'cedet)
  280. ;(require 'jde)
  281.  
  282. ;;;
  283. ;;; nXML mode
  284. ;;;
  285. (load "rng-auto.el")
  286. (setq auto-mode-alist
  287. (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\|html\\)\\'" . nxml-mode)
  288. auto-mode-alist))
  289. (setq magic-mode-alist
  290. (cons (cons (car (rassoc 'xml-mode magic-mode-alist)) 'nxml-mode)
  291. magic-mode-alist))
  292. (add-hook 'nxml-mode-hook '(lambda () (turn-on-auto-fill)))
  293.  
  294. ;;;
  295. ;;; perl-mode setup (cperl)
  296. ;;;
  297. (cond ((< emacs-major-version 20)
  298. (autoload 'perl-mode
  299. "cperl-mode" "alternate mode for editing Perl programs" t))
  300. (t
  301. (load "cperl-mode")
  302. (fset 'perl-mode (symbol-function 'cperl-mode))))
  303. (add-hook 'cperl-mode-hook '(lambda () (turn-on-auto-fill)))
  304.  
  305. ;;;
  306. ;;; Python mode
  307. ;;;
  308. (add-hook 'python-mode-hook '(lambda () (turn-on-auto-fill)))
  309.  
  310. ;;;
  311. ;;; Ruby mode
  312. ;;;
  313. (autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t)
  314. (setq auto-mode-alist (cons '("\\.rb$" . ruby-mode) auto-mode-alist))
  315. (setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
  316. interpreter-mode-alist))
  317. (add-hook 'ruby-mode-hook '(lambda () (turn-on-auto-fill)))
  318. (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process" t)
  319. (autoload 'inf-ruby-keys "inf-ruby"
  320. "Set local key defs for inf-ruby in ruby-mode")
  321. (add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys)))
  322. (autoload 'rubydb "rubydb3x" "Ruby debugger" t)
  323.  
  324. ;;;
  325. ;;; SGML mode (also XML)
  326. ;;;
  327. ;; (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
  328. ;; (autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
  329. ;; (setq auto-mode-alist (append '(("\\.xml$" . xml-mode)
  330. ;; ("\\.xsl$" . xml-mode))
  331. ;; auto-mode-alist))
  332. ;; (add-hook 'sgml-mode-hook
  333. ;; '(lambda () (setq sgml-insert-missing-element-comment nil)))
  334. ;; (add-hook 'xml-mode-hook
  335. ;; '(lambda ()
  336. ;; (setq sgml-validate-command "java sax.SAXCount -v %s %s")))
  337. ;; (setq sgml-local-ecat-files '("d:/share/docbook/xml/4.1.2/docbook.ecat"))
  338.  
  339. ;;;
  340. ;;; Subversion
  341. ;;;
  342. (require 'psvn)
  343.  
  344. ;;;
  345. ;;; text-mode setup
  346. ;;;
  347. (add-hook 'text-mode-hook '(lambda () (turn-on-auto-fill)))
  348.  
  349. ; ;; Visual SourceSafe
  350. ; (setq
  351. ; ss-program "d:\\Bin\\VSS\\WIN32\\SS.EXE"
  352. ; ss-project-dirs '(("^e:\\\\home\\\\kchristen\\\\srcsafe\\\\" .
  353. ; "$/NextGen/"))
  354. ; ss-tmp-dir "c:\\tmp")
  355. ; (if (< emacs-major-version 20)
  356. ; (load "source-safe-menu")
  357. ; (load "source-safe"))
  358.  
  359. ;;; A crude remapping of C-x C-q to do SourceSafe checkin and checkout
  360. ; (global-set-key
  361. ; "\C-x\C-q"
  362. ; (function
  363. ; (lambda ()
  364. ; (interactive)
  365. ; (let ((ss-working-dir "^e:/home/kchristen/srcsafe"))
  366. ; (if (string-match ss-working-dir (buffer-file-name))
  367. ; (if (ss-file-checked-out-p (buffer-file-name))
  368. ; (ss-update)
  369. ; (ss-checkout))
  370. ; (toggle-read-only))))))
  371.  
  372. ;;; sql-mode. See ~/.sql-mode for the rest
  373. ; (setq load-path (cons (concat site-lisp-dir "/sql-mode") load-path))
  374. ; (defvar sql-dataserver-type 'oracle)
  375. ; (require 'sql-mode)
  376. ; (sql-initialize)
  377. (autoload 'sql-ms "sql" "SQL mode for MS SQL Server." t)
  378.  
  379. ;;;
  380. ;;; Changes for Visual C++
  381. ;;;
  382. ;; Visual C++ generates make files with dos line terminators, but that
  383. ;; start with a comment ("#"). Emacs takes this to be a file that should
  384. ;; be opened using a unix coding system. Override that behavior.
  385. (modify-coding-system-alist 'file "\\.mak\\'" 'iso-latin-1-dos)
  386.  
  387. ;;;
  388. ;;; Stuff set by the `customize' command
  389. ;;;
  390. (custom-set-variables
  391. ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  392. ;; Your init file should contain only one such instance.
  393. '(compilation-scroll-output t)
  394. '(compile-command "ant -emacs -find build.xml")
  395. '(cperl-auto-newline t)
  396. '(cperl-brace-offset -4)
  397. '(cperl-clobber-lisp-bindings t)
  398. '(cperl-continued-statement-offset 4)
  399. '(cperl-electric-lbrace-space t)
  400. '(cperl-electric-linefeed t)
  401. '(cperl-electric-parens nil)
  402. '(cperl-font-lock t)
  403. '(cperl-indent-level 4)
  404. '(cperl-info-on-command-no-prompt t)
  405. '(cperl-label-offset -4)
  406. '(cperl-lazy-help-time 5)
  407. '(jde-ant-enable-find t)
  408. '(jde-ant-read-target t)
  409. '(jde-bug-jdk-directory "d:/bin/jdk1.3.1_01")
  410. '(jde-bug-vm-includes-jpda-p t)
  411. '(jde-build-function (quote (jde-ant-build)))
  412. '(jde-compile-option-debug (quote ("all" (t nil nil))))
  413. '(jde-db-debugger (quote ("JDEbug" "" . "Executable")) t)
  414. '(jde-jdk-doc-url "file:///D:/bin/jdk1.3.1_01/docs/api/index.html")
  415. '(nxml-auto-insert-xml-declaration-flag t))
  416. (custom-set-faces
  417. ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  418. ;; Your init file should contain only one such instance.
  419. )
  420.  
  421. (put 'downcase-region 'disabled nil)

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: hardwork23 on September 21, 2018

If you are here to know how you can easily get rid of all your hurdles facing while remembering password in microsoft edge so you can easily move to how to open saved passwords in microsoft edge and come to know about all those ways by which your work will be all easier.

You need to login to post a comment.