Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:genehack/emacs

  • Loading branch information...
commit f256447da8e19f0bb422ab05cf9dfadd2375ff4b 2 parents 6fe284f + c3837d5
@genehack authored
View
2  bin/build-most-recent-emacs
@@ -51,7 +51,7 @@ $^O eq 'darwin'
say "\n* CLEANING UP..." if $VERBOSE;
unlink( $tarball_file );
-chdir('/'); # so File::Temp can clean up on exit
+chdir('/'); # so File::Temp can clean up on exit
say "done.";
View
1  bin/check-emacs
@@ -1,4 +1,3 @@
#! /bin/sh
emacs -q --eval '(condition-case err (progn (load "~/.emacs.d/init.el") (kill-emacs 0)) (error (kill-emacs 1)))'
-
View
56 etc/builtins.el
@@ -48,7 +48,7 @@
(require 'font-lock)
(global-font-lock-mode 1)
(setq-default font-lock-maximum-decoration t
- font-lock-maximum-size nil)
+ font-lock-maximum-size nil)
(setq jit-lock-stealth-time 5
jit-lock-defer-contextually t
jit-lock-stealth-nice 0.5)
@@ -95,8 +95,8 @@ remove-leading-whitespace-on-kil-line tricks")
(setq auto-revert-verbose nil)
;;; HIGHLIGHTING
-;(set-face-foreground 'highlight "gray10")
-;(set-face-background 'highlight "yellow")
+;;(set-face-foreground 'highlight "gray10")
+;;(set-face-background 'highlight "yellow")
;;; HTML
(add-to-list 'auto-mode-alist '("\\.tt2?$" . html-mode))
@@ -123,32 +123,32 @@ remove-leading-whitespace-on-kil-line tricks")
(interactive)
(imenu--make-index-alist)
(let ((name-and-pos '())
- (symbol-names '()))
+ (symbol-names '()))
(flet ((addsymbols (symbol-list)
- (when (listp symbol-list)
- (dolist (symbol symbol-list)
- (let ((name nil) (position nil))
- (cond
- ((and (listp symbol) (imenu--subalist-p symbol))
- (addsymbols symbol))
- ((listp symbol)
- (setq name (car symbol))
- (setq position (cdr symbol)))
- ((stringp symbol)
- (setq name symbol)
- (setq position (get-text-property 1 'org-imenu-marker symbol))))
- (unless (or (null position) (null name))
- (add-to-list 'symbol-names name)
- (add-to-list 'name-and-pos (cons name position))))))))
+ (when (listp symbol-list)
+ (dolist (symbol symbol-list)
+ (let ((name nil) (position nil))
+ (cond
+ ((and (listp symbol) (imenu--subalist-p symbol))
+ (addsymbols symbol))
+ ((listp symbol)
+ (setq name (car symbol))
+ (setq position (cdr symbol)))
+ ((stringp symbol)
+ (setq name symbol)
+ (setq position (get-text-property 1 'org-imenu-marker symbol))))
+ (unless (or (null position) (null name))
+ (add-to-list 'symbol-names name)
+ (add-to-list 'name-and-pos (cons name position))))))))
(addsymbols imenu--index-alist))
(let* ((selected-symbol (ido-completing-read "Symbol? " symbol-names))
- (position (cdr (assoc selected-symbol name-and-pos))))
+ (position (cdr (assoc selected-symbol name-and-pos))))
(if (markerp position)
- (goto-char position) (goto-char (overlay-start position))))))
+ (goto-char position) (goto-char (overlay-start position))))))
;;; ISEARCH
-;(set-face-foreground 'isearch "white")
-;(set-face-background 'isearch "red")
+;;(set-face-foreground 'isearch "white")
+;;(set-face-background 'isearch "red")
;;; ISWITCH
(require 'iswitchb)
@@ -179,7 +179,7 @@ This is a buffer-local variable.")
(setq mac-function-modifier 'super)
(setq mac-option-modifier nil)
(add-to-list 'ido-ignore-files "\\.DS_Store")
-;; (ns-toggle-fullscreen)
+ ;; (ns-toggle-fullscreen)
(setq browse-url-browser-function 'browse-url-default-macosx-browser)
(setq delete-by-moving-to-trash t))
@@ -192,8 +192,8 @@ This is a buffer-local variable.")
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
;;; MODE LINE FACES
-;(set-face-background 'mode-line "black")
-;(set-face-foreground 'mode-line "yellow2")
+;;(set-face-background 'mode-line "black")
+;;(set-face-foreground 'mode-line "yellow2")
;;; NXML-MODE
(fset 'xml-mode 'nxml-mode)
@@ -217,7 +217,7 @@ This is a buffer-local variable.")
"/opt/git/bin"
"/opt/perl/bin"
"/usr/local/bin"
- )
+ )
"extra elements to add to exec-path")
(dolist (path genehack/extra-paths)
(message path)
@@ -247,7 +247,7 @@ This is a buffer-local variable.")
;;; SCRATCH BUFFER
(setq initial-scratch-message
- "welcome to john's emacs.\n\nput additional stuff in initial-scratch-message to have it show up here.\n\n")
+ "welcome to john's emacs.\n\nput additional stuff in initial-scratch-message to have it show up here.\n\n")
;;; SERVER
(server-start)
View
2  etc/keys.el
@@ -14,7 +14,7 @@
(global-set-key (kbd "C-c C-h") 'genehack/split-horizontally-or-delete-other-windows)
(global-set-key (kbd "C-c C-j") 'projectile-jump-to-project-file)
(global-set-key (kbd "C-c C-o") 'projectile-multi-occur)
-(global-set-key (kbd "C-c C-t") 'delete-trailing-whitespace)
+(global-set-key (kbd "C-c C-t") 'genehack/strip-whitespace-and-indent)
(global-set-key (kbd "C-c C-v") 'genehack/split-vertically-or-delete-other-windows)
(global-set-key (kbd "C-c C-x") 'maximize-frame)
(global-set-key (kbd "C-c M-x") 'execute-extended-command)
View
48 etc/misc.el
@@ -117,6 +117,23 @@
(autoload 'tidy-save-settings "tidy" "Save settings to `tidy-config-file'" t)
(autoload 'tidy-build-menu "tidy" "Install an options menu for HTML Tidy." t)
+;;; IDO-UBI
+;;;; from http://whattheemacsd.com//setup-ido.el-01.html
+;; Use ido everywhere
+(require 'ido-ubiquitous)
+(ido-ubiquitous-mode 1)
+
+;; Fix ido-ubiquitous for newer packages
+(defmacro ido-ubiquitous-use-new-completing-read (cmd package)
+ `(eval-after-load ,package
+ '(defadvice ,cmd (around ido-ubiquitous-new activate)
+ (let ((ido-ubiquitous-enable-compatibility nil))
+ ad-do-it))))
+
+(ido-ubiquitous-use-new-completing-read webjump 'webjump)
+(ido-ubiquitous-use-new-completing-read yas/expand 'yasnippet)
+(ido-ubiquitous-use-new-completing-read yas/visit-snippet-file 'yasnippet)
+
;;; JS2
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
@@ -229,7 +246,7 @@
(defun genehack/paren-bounce ()
(interactive)
(let ((prev-char (char-to-string (preceding-char)))
- (next-char (char-to-string (following-char))))
+ (next-char (char-to-string (following-char))))
(cond ((string-match "[[{(<]" next-char) (forward-sexp 1))
((string-match "[\]})>]" prev-char) (backward-sexp 1))
(t (error "%s" "Not an expression boundary.")))))
@@ -300,10 +317,24 @@
)
"List of modes where trailing whitespace should be stripped when saving files.")
+;;;; inspired by http://whattheemacsd.com/buffer-defuns.el-01.html
+(defun genehack/strip-whitespace ()
+ "Untabify, strip white space, set file coding to UTF8"
+ (interactive)
+ (untabify (point-min) (point-max))
+ (delete-trailing-whitespace)
+ (set-buffer-file-coding-system 'utf-8))
+
+(defun genehack/strip-whitespace-and-indent ()
+ "Strip various whitespaces and reindent whole file"
+ (interactive)
+ (genehack/strip-whitespace)
+ (indent-region (point-min) (point-max)))
+
(add-hook 'before-save-hook
(lambda ()
(if (find major-mode genehack/strip-trailing-whitespace-in-these-modes)
- (delete-trailing-whitespace))))
+ (genehack/strip-whitespace))))
;;; TEMPLATE
(require 'template-mode)
@@ -354,13 +385,14 @@
;;; YASNIPPET
(require 'yasnippet)
-(setq yas/root-directory (concat genehack/emacs-dir "share/snippets"))
-(if (file-exists-p yas/root-directory)
- (unless (file-directory-p yas/root-directory)
+(yas--initialize)
+(setq yas-snippet-dirs (concat genehack/emacs-dir "share/snippets"))
+(if (file-exists-p yas-snippet-dirs)
+ (unless (file-directory-p yas-snippet-dirs)
(error "Snippets directory creation blocked by file"))
- (make-directory yas/root-directory))
-(yas/load-directory yas/root-directory)
-(yas/global-mode 1)
+ (make-directory yas-snippet-dirs))
+(yas-load-directory yas-snippet-dirs)
+(yas-global-mode)
;; put this at the end so that everything is loaded...
;;; DIMINISH
View
46 etc/perl.el
@@ -24,41 +24,39 @@
;;; CONFIG
(setq
- cperl-auto-newline t
cperl-auto-indent-on-semi t
+ cperl-auto-newline t
+ cperl-clobber-lisp-bindings t
cperl-close-paren-offset -2
cperl-continued-statement-offset 2
- ;cperl-hairy t
+ cperl-electric-keywords t
+ cperl-electric-lbrace-space nil
+ cperl-electric-linefeed t
+ cperl-electric-parens nil
+ cperl-font-lock t
cperl-highlight-variables-indiscriminately t
cperl-indent-level 2
cperl-indent-parens-as-block t
- cperl-invalid-face nil
- cperl-tab-always-indent t
- cperl-electric-lbrace-space nil ; must needs be after cperl-hairy
- cperl-clobber-lisp-bindings nil ; must needs be after cperl-hairy
-
- cperl-electric-parens nil
- cperl-font-lock t
- cperl-electric-linefeed t
- cperl-electric-keywords t
+ cperl-indent-region-fix-constructs nil
cperl-info-on-command-no-prompt t
- cperl-clobber-lisp-bindings t
+ cperl-invalid-face nil
cperl-lazy-help-time 5
+ cperl-tab-always-indent t
)
(defvar genehack/cperl-keybindings-to-remove
'(
- "\C-c\C-a"
- "\C-c\C-b"
- "\C-c\C-d"
- "\C-c\C-hP"
- "\C-c\C-ha"
- "\C-c\C-hp"
- "\C-c\C-j"
- "\C-c\C-t"
- "\C-c\C-v"
- "\C-c\C-x"
- ) "list of keybindings to unset in cperl-mode buffers
+ "\C-c\C-a"
+ "\C-c\C-b"
+ "\C-c\C-d"
+ "\C-c\C-hP"
+ "\C-c\C-ha"
+ "\C-c\C-hp"
+ "\C-c\C-j"
+ "\C-c\C-t"
+ "\C-c\C-v"
+ "\C-c\C-x"
+ ) "list of keybindings to unset in cperl-mode buffers
since cperl-mode steps on a lot of the C-c C-* bindings I use globallly..." )
;;; perl COMPLETION
@@ -97,7 +95,7 @@ or vice versa."
(defun genehack/cperl-mode-setup ()
;; allows 'M-x compile' for syntax checking of Perl scripts within Emacs
- ;; from e.goerlach@computer.org (Ekkehard Görlach) in comp.emacs
+ ;; from e.goerlach@computer.org (Ekkehard Görlach) in comp.emacs
(set (make-local-variable 'compile-command)
(concat "perl -cw " buffer-file-name))
(font-lock-add-keywords nil '(("^[^\n]\\{90\\}\\(.*\\)$" 1 font-lock-warning-face t)))
View
11 init.el
@@ -96,6 +96,7 @@
gist
git-blame
ido-hacks
+ ido-ubiquitous
js2-mode
kolon-mode
magit
@@ -128,11 +129,11 @@
(dolist (pkg genehack/package-list)
(if (not (package-installed-p pkg))
(progn
- (if (not (eq genehack/packages-refreshed t))
- (progn
- (package-refresh-contents)
- (setq genehack/packages-refreshed t)))
- (package-install pkg))))
+ (if (not (eq genehack/packages-refreshed t))
+ (progn
+ (package-refresh-contents)
+ (setq genehack/packages-refreshed t)))
+ (package-install pkg))))
;; PATH FIX FOR MACOS X
(when (memq window-system '(mac ns))
View
1  share/snippets/cperl-mode/open.yasnippet
@@ -1,6 +1,7 @@
# -*- mode: snippet -*-
# name: open (3 arg)a
# contributor: genehack
+# key: open
# --
open( my $1 , '$2' , "$3" )
or die( "Unable to open $3 : $!" );
View
3  share/snippets/cperl-mode/useperl → share/snippets/cperl-mode/shebang
@@ -1,4 +1,5 @@
-#name : #! `which perl`
+#name : shebang + usual use
+#key: #!perl
# --
#! `(executable-find "perl")`
Please sign in to comment.
Something went wrong with that request. Please try again.