Make my init comply with Emacs standards
This commit is contained in:
		
							
								
								
									
										22
									
								
								init.el
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								init.el
									
									
									
									
									
								
							| @@ -1,3 +1,9 @@ | |||||||
|  | ;;; init --- Summary | ||||||
|  |  | ||||||
|  | ;;; Commentary: | ||||||
|  |  | ||||||
|  | ;;; Code: | ||||||
|  |  | ||||||
| (setq custom-file (concat user-emacs-directory "customizations.el")) | (setq custom-file (concat user-emacs-directory "customizations.el")) | ||||||
| (load custom-file) | (load custom-file) | ||||||
|  |  | ||||||
| @@ -16,7 +22,7 @@ | |||||||
|              '("org" . "http://orgmode.org/elpa/") t) |              '("org" . "http://orgmode.org/elpa/") t) | ||||||
| (package-initialize) | (package-initialize) | ||||||
|  |  | ||||||
| (setq use-package-always-ensure t) | (setq-default use-package-always-ensure t) | ||||||
|  |  | ||||||
| (unless (package-installed-p 'use-package) | (unless (package-installed-p 'use-package) | ||||||
|   (package-refresh-contents) |   (package-refresh-contents) | ||||||
| @@ -197,6 +203,7 @@ | |||||||
|     (setq zone-programs (vconcat zone-programs [zone-nyan])))) |     (setq zone-programs (vconcat zone-programs [zone-nyan])))) | ||||||
|  |  | ||||||
| (defun gpolonkai/zone-enable () | (defun gpolonkai/zone-enable () | ||||||
|  |   "Enable zoning out." | ||||||
|   (interactive) |   (interactive) | ||||||
|   (zone-when-idle 60) |   (zone-when-idle 60) | ||||||
|   (message "I will zone out after idling for 60 seconds.")) |   (message "I will zone out after idling for 60 seconds.")) | ||||||
| @@ -359,7 +366,7 @@ | |||||||
| ;; From gmane.emacs.orgmode | ;; From gmane.emacs.orgmode | ||||||
| ;; (http://article.gmane.org/gmane.emacs.orgmode/75222) | ;; (http://article.gmane.org/gmane.emacs.orgmode/75222) | ||||||
| (defun f-ediff-org-showhide (buf command &rest cmdargs) | (defun f-ediff-org-showhide (buf command &rest cmdargs) | ||||||
|   "If buffer BUF exists and in org-mode, execute COMMAND with CMDARGS." |   "If buffer BUF exists and in `org-mode', execute COMMAND with CMDARGS." | ||||||
|   (when buf |   (when buf | ||||||
|     (when (eq (buffer-local-value 'major-mode (get-buffer buf)) 'org-mode) |     (when (eq (buffer-local-value 'major-mode (get-buffer buf)) 'org-mode) | ||||||
|       (save-excursion |       (save-excursion | ||||||
| @@ -1134,7 +1141,7 @@ INFO plist." | |||||||
|                                     (knr-argdecl-intro . -) |                                     (knr-argdecl-intro . -) | ||||||
|                                     (comment-intro . 0))) |                                     (comment-intro . 0))) | ||||||
|     (c-echo-syntactic-information-p . t)) |     (c-echo-syntactic-information-p . t)) | ||||||
|   "My C Programming Style") |   "My C Programming Style.") | ||||||
| (c-add-style "PERSONAL" my-c-style) | (c-add-style "PERSONAL" my-c-style) | ||||||
| (setq c-offset-alist '((member-init-intro . ++))) | (setq c-offset-alist '((member-init-intro . ++))) | ||||||
|  |  | ||||||
| @@ -1194,7 +1201,7 @@ INFO plist." | |||||||
| ;; Kudos goes to | ;; Kudos goes to | ||||||
| ;; http://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html | ;; http://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html | ||||||
| (defun isearch-exit-other-end () | (defun isearch-exit-other-end () | ||||||
|   "Exit isearch, at the opposite end of the string" |   "Exit isearch, at the opposite end of the string." | ||||||
|   (interactive) |   (interactive) | ||||||
|  |  | ||||||
|   (isearch-exit) |   (isearch-exit) | ||||||
| @@ -1257,6 +1264,7 @@ INFO plist." | |||||||
|                                             "%b"))))) |                                             "%b"))))) | ||||||
|  |  | ||||||
| (defun gpolonkai/helm-ff-slash-dir-complete () | (defun gpolonkai/helm-ff-slash-dir-complete () | ||||||
|  |   "Make forward slash (/) do completion in helm." | ||||||
|   (interactive) |   (interactive) | ||||||
|   (if (and (equal "Find Files" (assoc-default 'name (helm-get-current-source))) |   (if (and (equal "Find Files" (assoc-default 'name (helm-get-current-source))) | ||||||
|            (stringp (helm-get-selection)) |            (stringp (helm-get-selection)) | ||||||
| @@ -1270,6 +1278,9 @@ INFO plist." | |||||||
|  |  | ||||||
| ;; It will test whether it can expand, if yes, cursor color -> purple. | ;; It will test whether it can expand, if yes, cursor color -> purple. | ||||||
| (defun yasnippet-can-fire-p (&optional field) | (defun yasnippet-can-fire-p (&optional field) | ||||||
|  |   "Check if the word before point can be expanded with yasnippet. | ||||||
|  |  | ||||||
|  | TODO: What is FIELD for?" | ||||||
|   (interactive) |   (interactive) | ||||||
|   (setq yas--condition-cache-timestamp (current-time)) |   (setq yas--condition-cache-timestamp (current-time)) | ||||||
|   (let (templates-and-pos) |   (let (templates-and-pos) | ||||||
| @@ -1285,6 +1296,9 @@ INFO plist." | |||||||
|  |  | ||||||
| ;; Taken from http://pages.sachachua.com/.emacs.d/Sacha.html | ;; Taken from http://pages.sachachua.com/.emacs.d/Sacha.html | ||||||
| (defun sachachua/change-cursor-color-when-can-expand (&optional field) | (defun sachachua/change-cursor-color-when-can-expand (&optional field) | ||||||
|  |   "Change cursor color if the text before point can be expanded with yasnippet. | ||||||
|  |  | ||||||
|  | TODO: What is FIELD for?" | ||||||
|   (interactive) |   (interactive) | ||||||
|   (when (eq last-command 'self-insert-command) |   (when (eq last-command 'self-insert-command) | ||||||
|     (set-cursor-color (if (sachachua/can-expand) |     (set-cursor-color (if (sachachua/can-expand) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user