Skip to content

Commit

Permalink
Various updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Aug 2, 2012
1 parent 4ccc62a commit 5d01427
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 89 deletions.
3 changes: 3 additions & 0 deletions dot-org.el
Expand Up @@ -24,6 +24,9 @@

;;(load "org-log" t)

(fset 'org-link-to-named-task
[?\C- ?\C- ?\C-e ?\C-w ?\C-s ?\M-y ?\C-a ?\M-f ?\C-c ?S ?\C-u ?\C- ?\C-c ?\C-l return return ?\C-x ?\C-x ?\C- ?\C- ])

(defun org-find-top-category (&optional pos)
(let ((cat
(save-excursion
Expand Down
4 changes: 2 additions & 2 deletions gnus-settings.el
Expand Up @@ -14,8 +14,8 @@
'(gnus-agent-synchronize-flags t)
'(gnus-alias-default-identity "Gmail")
'(gnus-alias-identity-alist (quote (("Gmail" "" "\"John Wiegley\" <jwiegley@gmail.com>" "" nil "" "") ("BoostPro" "" "\"John Wiegley\" <johnw@boostpro.com>" "BoostPro Computing, Inc." nil "" "John Wiegley
BoostPro Computing
http://www.boostpro.com") ("NewArtisans" "" "\"John Wiegley\" <johnw@newartisans.com>" "New Artisans LLC" nil "" ""))))
BoostPro Computing Software Development Training
http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost") ("NewArtisans" "" "\"John Wiegley\" <johnw@newartisans.com>" "New Artisans LLC" nil "" ""))))
'(gnus-alias-identity-rules (quote (("Ledger Mailing List" ("To" "ledger-cli@googlegroups\\.com" current) "NewArtisans") ("Emacs Mailing Lists" ("To" "emacs" current) "NewArtisans") ("Emacs Newsgroups" ("Newsgroups" "emacs" current) "NewArtisans") ("BoostPro Mail" ("From" "@boostpro\\.com" current) "BoostPro") ("BoostPro Clients" ("To" "@\\(ti\\)\\.com" current) "BoostPro") ("BoostPro Clients (Copied)" ("Cc" "@\\(ti\\)\\.com" current) "BoostPro") ("C++, LLVM, Boost, and Clang Groups" ("Newsgroups" "\\(c\\+\\+\\|clang\\|llvm\\|[Bb]oost\\|[Rr]yppl\\)" current) "BoostPro") ("C++, LLVM, Boost, and Clang Mailing Lists" ("To" "\\(c\\+\\+\\|clang\\|llvm\\|[Bb]oost\\|[Rr]yppl\\|llvm\\|cfe\\)" current) "BoostPro"))))
'(gnus-alias-override-user-mail-address t)
'(gnus-alias-unknown-identity-rule (quote error))
Expand Down
159 changes: 78 additions & 81 deletions init.el
Expand Up @@ -700,6 +700,24 @@
("\\.mm\\'" . c++-mode))
:init
(progn
(defun llvm-info ()
(interactive)
(w3m-find-file "/usr/local/stow/clang-3.1/docs/llvm/html/doxygen/classllvm_1_1IRBuilder.html"))

(defun my-paste-as-check ()
(interactive)
(save-excursion
(insert "/*\n")
(let ((beg (point)) end)
(yank)
(setq end (point-marker))
(goto-char beg)
(while (< (point) end)
(forward-char 2)
(insert "CHECK: ")
(forward-line 1)))
(insert "*/\n")))

(defun my-c-indent-or-complete ()
(interactive)
(let ((class (syntax-class (syntax-after (1- (point))))))
Expand Down Expand Up @@ -762,6 +780,7 @@

(unbind-key "M-j" c-mode-base-map)
(bind-key "C-c C-i" 'c-includes-current-file c-mode-base-map)
(bind-key "C-c C-y" 'my-paste-as-check c-mode-base-map)

(set (make-local-variable 'parens-require-spaces) nil)
(setq indicate-empty-lines t)
Expand All @@ -775,10 +794,12 @@
((string-match "/ledger/" bufname)
(c-set-style "ledger"))
((string-match "/ansi/" bufname)
(c-set-style "edg")
(c-set-style "ti")
(substitute-key-definition 'fill-paragraph 'ti-refill-comment
c-mode-base-map global-map)
(bind-key "M-q" 'ti-refill-comment c-mode-base-map))
((string-match "/edg/" bufname)
(c-set-style "edg"))
(t
(c-set-style "clang")))))

Expand Down Expand Up @@ -828,7 +849,7 @@
(semanticdb-enable-gnu-global-databases 'c++-mode))))

(add-to-list 'c-style-alist
'("edg"
'("ti"
(indent-tabs-mode . nil)
(c-basic-offset . 3)
(c-comment-only-line-offset . (0 . 0))
Expand All @@ -854,6 +875,33 @@
(c-special-indent-hook . c-gnu-impose-minimum)
(c-block-comment-prefix . "")))

(add-to-list 'c-style-alist
'("edg"
(indent-tabs-mode . nil)
(c-basic-offset . 2)
(c-comment-only-line-offset . (0 . 0))
(c-hanging-braces-alist
. ((substatement-open before after)
(arglist-cont-nonempty)))
(c-offsets-alist
. ((statement-block-intro . +)
(knr-argdecl-intro . 5)
(substatement-open . 0)
(substatement-label . 0)
(label . 0)
(case-label . +)
(statement-case-open . 0)
(statement-cont . +)
(arglist-intro . +)
(arglist-close . +)
(inline-open . 0)
(brace-list-open . 0)
(topmost-intro-cont
. (first c-lineup-topmost-intro-cont
c-lineup-gnu-DEFUN-intro-cont))))
(c-special-indent-hook . c-gnu-impose-minimum)
(c-block-comment-prefix . "")))

(add-to-list 'c-style-alist
'("ledger"
(indent-tabs-mode . nil)
Expand Down Expand Up @@ -1238,6 +1286,7 @@
;;;_ , bbdb

(use-package bbdb-com
:commands bbdb-create
:bind ("M-B" . bbdb))

;;;_ , bm
Expand Down Expand Up @@ -1839,14 +1888,16 @@ FORM => (eval FORM)."
default)
(+ 24 (length default)))
'grep-find-history))))
(when command-args
(let ((null-device nil)) ; see grep
(grep command-args))))
(if command-args
(let ((null-device nil)) ; see grep
(grep command-args))))

(bind-key "M-s p" 'find-grep-in-project))

:config
(progn
(use-package grep-ed)

(grep-apply-setting 'grep-command "egrep -nH -e ")
(grep-apply-setting
'grep-find-command
Expand Down Expand Up @@ -1920,13 +1971,34 @@ FORM => (eval FORM)."
(use-package hs-lint)

(use-package ghc
:disabled t
:commands ghc-init
:init
(add-hook 'haskell-mode-hook 'ghc-init))

(use-package scion
:disabled t
:load-path "site-lisp/scion/emacs"
:init
(progn
;; if ./cabal/bin is not in your $PATH
(setq scion-program (expand-file-name "~/.cabal/bin/scion-server"))

;; Use ido-mode completion (matches anywhere, not just beginning)
;;
;; WARNING: This causes some versions of Emacs to fail so badly that
;; Emacs needs to be restarted.
(setq scion-completing-read-function 'ido-completing-read)))

(defun my-haskell-mode-hook ()
(setq haskell-saved-check-command haskell-check-command)

;; Whenever we open a file in Haskell mode, also activate Scion
(scion-mode 1)
;; Whenever a file is saved, immediately type check it and highlight
;; errors/warnings in the source.
(scion-flycheck-on-save 1)

(bind-key "C-c w" 'flymake-display-err-menu-for-current-line
haskell-mode-map)
(bind-key "C-c *" 'flymake-start-syntax-check haskell-mode-map)
Expand Down Expand Up @@ -2800,83 +2872,8 @@ end tell" account account start duration commodity (if cleared "true" "false")

(use-package puppet-mode
:mode ("\\.pp\\'" . puppet-mode)

:config
(progn
(push '(ruby-arrow
(regexp . "\\(\\s-*\\)=>\\(\\s-*\\)")
(group . (1 2))
(modes . '(ruby-mode puppet-mode)))
align-rules-list)

(defvar puppet-anchor-point nil)

(defun puppet-set-anchor ()
(interactive)
(setq puppet-anchor-point (point-marker))
(message "puppet-mode anchor set at %s"
(marker-position puppet-anchor-point)))

(defun puppet-resource-beginning ()
(save-excursion
(and (re-search-backward
"^\\s-*\\(\\S-+\\)\\s-+{\\s-+\\([^:]+\\):" nil t)
(list (match-beginning 0)
(match-string 1) (match-string 2)))))

(defun puppet-resource-end ()
(save-excursion
(and (re-search-forward "^\\s-*}" nil t)
(match-end 0))))

(defun puppet-create-require ()
(interactive)
(require 'align)
(if (null puppet-anchor-point)
(error "Anchor point has not been set")
(destructuring-bind (anchored-start resource name)
(save-excursion
(goto-char puppet-anchor-point)
(puppet-resource-beginning))
(save-excursion
(let ((beginning (car (puppet-resource-beginning)))
(end (puppet-resource-end)))
(goto-char end)
(backward-char)
(let ((current-requires
(when (re-search-backward
"^\\s-*require\\s-*=>\\s-*" beginning t)
(let ((start (match-beginning 0))
(beg (match-end 0)))
(if (looking-at "\\[")
(forward-sexp))
(re-search-forward "\\([,;]\\)?[ \t]*\n")
(prog1
(buffer-substring-no-properties
beg (match-beginning 0))
(delete-region start (point)))))))
(save-excursion
(skip-chars-backward " \t\n\r")
(when (looking-back ";")
(delete-backward-char 1)
(insert ?,)))
(insert " require => ")
(if current-requires
(insert "[ " current-requires ", "))
(insert (capitalize (substring resource 0 1))
(substring resource 1) "[" name "]")
(if current-requires
(insert " ]"))
(insert ";\n")
(mark-paragraph)
(align-code (region-beginning) (region-end))))))))

;; (define-key puppet-mode-map [(control ?x) ? ] 'puppet-set-anchor)
;; (define-key puppet-mode-map [(control ?x) space] 'puppet-set-anchor)
;; (define-key puppet-mode-map [(control ?c) (control ?r)] 'puppet-create-require)

(bind-key "C-x SPC" 'puppet-set-anchor puppet-mode-map)
(bind-key "C-c C-r" 'puppet-create-require puppet-mode-map)))
(use-package puppet-ext))

;;;_ , python-mode

Expand Down
2 changes: 1 addition & 1 deletion lisp/use-package
Submodule use-package updated 1 files
+6 −3 use-package.el

0 comments on commit 5d01427

Please sign in to comment.