Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 16 commits
  • 14 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 28, 2013
@winfred-lu Pull evil and magit.
Remove local jump-item and close/open-fold and switch to evil.
fe5c26a
Commits on Jan 29, 2013
@winfred-lu To kill the buffer without querying clients. 6fd9b3d
@winfred-lu Make dired to reuse the directory buffer. d88df84
Commits on Feb 01, 2013
@winfred-lu Fix not to jump to the declartion but the function itself.
In c-mode, when trying to jump to the tag of a function,
and if the function declaration exists in the same file,
the old etag-select jumped to the declartion since the string would be the same as text-to-search-for.
45d2980
@winfred-lu Pull evil. 04aeeec
@winfred-lu Add etags-select, ipython. fb51496
Commits on Feb 02, 2013
@winfred-lu Use dolist instead of loop for. c8ecf01
@winfred-lu Add color-theme-jsc-light from the library. d2ee410
@winfred-lu Use makefile instead. 83698a7
@winfred-lu Add ditaa.jar. 1eab1ed
@winfred-lu Switch autopair from google code to github. d410ab8
@winfred-lu Compile autopair. 1da75b6
Commits on Feb 03, 2013
@winfred-lu Remove toggle-indicate-empty-lines. 46bd97f
@winfred-lu Pull evil. 04b420b
Commits on Feb 06, 2013
@winfred-lu Fix not to jump to the declartion but the function itself.
Commit 45d2980 does not fix it fully.

It is possible that the function declaration does not contain a semicolon in
the end of the first line (for example, arguments are written in seperated
lines).
In such cases, text-to-search-for matches for both the declaration and the
function itself, search will stop at the declartion.

This commit works around for these cases. It searches backward instead. Thus
it only works if the selected tag is the only tag in the file. The better
solution would be to refer the line number in the TAGS file. (TODO)
735f5ff
Commits on Feb 13, 2013
@winfred-lu Pull evil, magit. 9338887
Showing with 207 additions and 1,173 deletions.
  1. +3 −0 .gitmodules
  2. +25 −0 Makefile
  3. +1 −1 README.md
  4. BIN ditaa.jar
  5. +1 −0 vendor/autopair
  6. +0 −1,069 vendor/autopair.el
  7. +0 −21 vendor/compile.sh
  8. +14 −7 vendor/etags-select.el
  9. +1 −1 vendor/evil
  10. +1 −1 vendor/magit
  11. +6 −4 winfred-buffer.el
  12. +138 −0 winfred-color-theme.el
  13. +14 −68 winfred-evil.el
  14. +3 −1 winfred-visual.el
View
3 .gitmodules
@@ -13,3 +13,6 @@
[submodule "vendor/evil-nerd-commenter"]
path = vendor/evil-nerd-commenter
url = git://github.com/redguardtoo/evil-nerd-commenter.git
+[submodule "vendor/autopair"]
+ path = vendor/autopair
+ url = git://github.com/capitaomorte/autopair
View
25 Makefile
@@ -0,0 +1,25 @@
+EMACS = emacs
+
+VENDOR = $(filter-out vendor/csharp-mode-0.8.5.el, $(wildcard vendor/*.el))
+VENDOR += vendor/autopair/autopair.el
+FILES = $(VENDOR) $(wildcard winfred-*.el)
+ELCFILES = $(FILES:.el=.elc)
+
+DIRS = . $(shell find vendor -maxdepth 1 -type d)
+LOADPATH = $(foreach d, $(DIRS), -L $d)
+
+.PHONY: all clean
+
+all: $(ELCFILES)
+ $(MAKE) -C vendor/evil
+ $(MAKE) -C vendor/magit
+ cd vendor/yasnippet && rake compile
+
+clean:
+ rm -f *~
+ rm -f \#*\#
+ rm -f .depend
+ rm -f $(ELCFILES)
+
+$(ELCFILES): %.elc: %.el
+ $(EMACS) --batch -Q $(LOADPATH) -f batch-byte-compile $<
View
2 README.md
@@ -11,7 +11,7 @@ Installation
Optional:
- $ ./vendor/compile.sh
+ $ make
Usage
-----------
View
BIN ditaa.jar
Binary file not shown.
1 vendor/autopair
@@ -0,0 +1 @@
+Subproject commit 274a54a8a7182330d924b118815b352803396977
View
1,069 vendor/autopair.el
@@ -1,1069 +0,0 @@
-;;; autopair.el --- Automagically pair braces and quotes like TextMate
-
-;; Copyright (C) 2009,2010 Joao Tavora
-
-;; Author: Joao Tavora <joaotavora [at] gmail.com>
-;; Keywords: convenience, emulations
-;; X-URL: http://autopair.googlecode.com
-;; URL: http://autopair.googlecode.com
-;; EmacsWiki: AutoPairs
-;; Version: 0.4
-;; Revision: $Rev$ ($LastChangedDate$)
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; Another stab at making braces and quotes pair like in
-;; TextMate:
-;;
-;; * Opening braces/quotes are autopaired;
-;; * Closing braces/quotes are autoskipped;
-;; * Backspacing an opening brace/quote autodeletes its adjacent pair.
-;; * Newline between newly-opened brace pairs open an extra indented line.
-;;
-;; Autopair deduces from the current syntax table which characters to
-;; pair, skip or delete.
-;;
-;;; Installation:
-;;
-;; (require 'autopair)
-;; (autopair-global-mode) ;; to enable in all buffers
-;;
-;; To enable autopair in just some types of buffers, comment out the
-;; `autopair-global-mode' and put autopair-mode in some major-mode
-;; hook, like:
-;;
-;; (add-hook 'c-mode-common-hook #'(lambda () (autopair-mode)))
-;;
-;; Alternatively, do use `autopair-global-mode' and create
-;; *exceptions* using the `autopair-dont-activate' local variable,
-;; like:
-;;
-;; (add-hook 'c-mode-common-hook #'(lambda () (setq autopair-dont-activate t)))
-;;
-;;; Use:
-;;
-;; The extension works by rebinding the braces and quotes keys, but
-;; can still be minimally intrusive, since the original binding is
-;; always called as if autopair did not exist.
-;;
-;; The decision of which keys to actually rebind is taken at
-;; minor-mode activation time, based on the current major mode's
-;; syntax tables. To achieve this kind of behaviour, an emacs
-;; variable `emulation-mode-map-alists' was used.
-;;
-;; If you set `autopair-pair-criteria' and `autopair-skip-criteria' to
-;; 'help-balance (which, by the way, is the default), braces are not
-;; autopaired/autoskiped in all situations; the decision to autopair
-;; or autoskip a brace is taken according to the following table:
-;;
-;; +---------+------------+-----------+-------------------+
-;; | 1234567 | autopair? | autoskip? | notes |
-;; +---------+------------+-----------+-------------------+
-;; | (()) | yyyyyyy | ---yy-- | balanced |
-;; +---------+------------+-----------+-------------------+
-;; | (())) | ------y | ---yyy- | too many closings |
-;; +---------+------------+-----------+-------------------+
-;; | ((()) | yyyyyyy | ------- | too many openings |
-;; +---------+------------+-----------+-------------------+
-;;
-;; The table is read like this: in a buffer with 7 characters laid out
-;; like the first column, an "y" marks points where an opening brace
-;; is autopaired and in which places would a closing brace be
-;; autoskipped.
-;;
-;; Quote pairing tries to support similar "intelligence", but is less
-;; deterministic. Some inside-string or inside-comment situations may
-;; not always behave how you intend them to.
-;;
-;; The variable `autopair-autowrap' tells autopair to automatically
-;; wrap the selection region with the delimiters you're trying to
-;; insert. This is done conditionally based of syntaxes of the two
-;; ends of the selection region. It is compatible with `cua-mode's
-;; typing-deletes-selection behaviour. This feature is probably still
-;; a little unstable, hence `autopair-autowrap' defaults to nil.
-;;
-;; If you find the paren-blinking annoying, turn `autopair-blink' to
-;; nil.
-;;
-;; For lisp-programming you might also like `autopair-skip-whitespace'.
-;;
-;; For further customization have a look at `autopair-dont-pair',
-;; `autopair-handle-action-fns' and `autopair-extra-pairs'.
-;;
-;; `autopair-dont-pair' lets you define special cases of characters
-;; you don't want paired. Its default value skips pairing
-;; single-quote characters when inside a comment literal, even if the
-;; language syntax tables does pair these characters.
-;;
-;; (defvar autopair-dont-pair `(:string (?') :comment (?'))
-;;
-;; As a further example, to also prevent the '{' (opening brace)
-;; character from being autopaired in C++ comments use this in your
-;; .emacs.
-;;
-;; (add-hook 'c++-mode-hook
-;; #'(lambda ()
-;; (push ?{
-;; (getf autopair-dont-pair :comment))))
-;;
-;; `autopair-handle-action-fns' lets you override/extend the actions
-;; taken by autopair after it decides something must be paired,skipped
-;; or deleted. To work with triple quoting in python mode, you can use
-;; this for example:
-;;
-;; (add-hook 'python-mode-hook
-;; #'(lambda ()
-;; (setq autopair-handle-action-fns
-;; (list #'autopair-default-handle-action
-;; #'autopair-python-triple-quote-action))))
-;;
-;; It's also useful to deal with latex's mode use of the "paired
-;; delimiter" syntax class.
-;;
-;; (add-hook 'latex-mode-hook
-;; #'(lambda ()
-;; (set (make-local-variable 'autopair-handle-action-fns)
-;; (list #'autopair-default-handle-action
-;; #'autopair-latex-mode-paired-delimiter-action))))
-;;
-;; `autopair-extra-pairs' lets you define extra pairing and skipping
-;; behaviour for pairs not programmed into the syntax table. Watch
-;; out, this is work-in-progress, a little unstable and does not help
-;; balancing at all. To have '<' and '>' pair in c++-mode buffers, but
-;; only in code, use:
-;;
-;; (add-hook 'c++-mode-hook
-;; #'(lambda ()
-;; (push '(?< . ?>)
-;; (getf autopair-extra-pairs :code))))
-;;
-;; if you program in emacs-lisp you might also like the following to
-;; pair backtick and quote
-;;
-;; (add-hook 'emacs-lisp-mode-hook
-;; #'(lambda ()
-;; (push '(?` . ?')
-;; (getf autopair-extra-pairs :comment))
-;; (push '(?` . ?')
-;; (getf autopair-extra-pairs :string))))
-;;
-;;; Bugs:
-;;
-;; * Quote pairing/skipping inside comments is not perfect...
-;;
-;; * See the last section on monkey-patching for the `defadvice'
-;; tricks used to make `autopair-autowrap' work with `cua-mode' and
-;; `delete-selection-mode'.
-;;
-;;; Credit:
-;;
-;; Thanks Ed Singleton for early testing.
-;;
-;;; Code:
-
-;; requires
-(require 'cl)
-
-;; variables
-(defvar autopair-pair-criteria 'help-balance
- "How to decide whether to pair opening brackets or quotes.
-
-Set this to 'always to always pair, or 'help-balance to be more
-criterious when pairing.")
-
-(defvar autopair-skip-criteria 'help-balance
- "How to decide whether to skip closing brackets or quotes.
-
-Set this to 'always to always skip, or 'help-balance to be more
-criterious when skipping.")
-
-(defvar autopair-emulation-alist nil
- "A dinamic keymap for autopair set mostly from the current
- syntax table.")
-
-(defvar autopair-dont-activate nil
- "Control activation of `autopair-global-mode'.
-
-Set this to a non-nil value to skip activation of `autopair-mode'
-in certain contexts. If however the value satisfies `functionp'
-and is a function of no arguments, the function is called and it is
-the return value that decides.")
-(make-variable-buffer-local 'autopair-dont-activate)
-
-(defvar autopair-extra-pairs nil
- "Extra pairs for which to use pairing.
-
-It's a Common-lisp-style even-numbered property list, each pair
-of elements being of the form (TYPE , PAIRS). PAIRS is a mixed
-list whose elements are cons cells, which look like cells look
-like (OPENING . CLOSING). Autopair pairs these like
-parenthesis.
-
-TYPE can be one of:
-
-:string : whereby PAIRS will be considered only when inside a
- string literal
-
-:comment : whereby PAIRS will be considered only when inside a comment
-
-:code : whereby PAIRS will be considered only when outisde a
- string and a comment.
-
-:everywhere : whereby PAIRS will be considered in all situations
-
-In Emacs-lisp, this might be useful
-
-(add-hook 'emacs-lisp-mode-hook
- #'(lambda ()
- (setq autopair-extra-pairs `(:comment ((?`. ?'))))))
-
-
-Note that this does *not* work for single characters,
-e.x. characters you want to behave as quotes. See the
-docs/source comments for more details.")
-
-(make-variable-buffer-local 'autopair-extra-pairs)
-
-(defvar autopair-dont-pair `(:string (?') :comment (?'))
- "Characters for which to skip any pairing behaviour.
-
-This variable overrides `autopair-pair-criteria' and
-`autopair-extra-pairs'. It does not
- (currently) affect the skipping behaviour.
-
-It's a Common-lisp-style even-numbered property list, each pair
-of elements being of the form (TYPE , CHARS). CHARS is a list of
-characters and TYPE can be one of:
-
-:string : whereby characters in CHARS will not be autopaired when
- inside a string literal
-
-:comment : whereby characters in CHARS will not be autopaired when
- inside a comment
-
-:never : whereby characters in CHARS won't even have their
- bindings replaced by autopair's. This particular option
- should be used for troubleshooting and requires
- `autopair-mode' to be restarted to have any effect.")
-(make-variable-buffer-local 'autopair-dont-pair)
-
-(defvar autopair-action nil
- "Autopair action decided on by last interactive autopair command, or nil.
-
-When autopair decides on an action this is a list whose first
-three elements are (ACTION PAIR POS-BEFORE).
-
-ACTION is one of `opening', `insert-quote', `skip-quote',
-`backspace', `newline' or `paired-delimiter'. PAIR is the pair of
-the `autopair-inserted' character, if applicable. POS-BEFORE is
-value of point before action command took place .")
-
-
-(defvar autopair-wrap-action nil
- "Autowrap action decided on by autopair, if any.
-
-When autopair decides on an action this is a list whose first
-three elements are (ACTION PAIR POS-BEFORE REGION-BEFORE).
-
-ACTION can only be `wrap' currently. PAIR and POS-BEFORE
-delimiter are as in `autopair-action'. REGION-BEFORE is a cons
-cell with the bounds of the region before the command takes
-place")
-
-(defvar autopair-handle-action-fns '()
- "Autopair handlers to run *instead* of the default handler.
-
-Each element is a function taking three arguments (ACTION, PAIR
-and POS-BEFORE), which are the three elements of the
-`autopair-action' variable, which see.
-
-If non-nil, these functions are called *instead* of the single
-function `autopair-default-handle-action', so use this variable
-to specify special behaviour. To also run the default behaviour,
-be sure to include `autopair-default-handle-action' in the
-list, or call it from your handlers.")
-(make-variable-buffer-local 'autopair-handle-action-fns)
-
-(defvar autopair-handle-wrap-action-fns '()
- "Autopair wrap handlers to run *instead* of the default handler.
-
-Each element is a function taking four arguments (ACTION, PAIR,
-POS-BEFORE and REGION-BEFORE), which are the three elements of the
-`autopair-wrap-action' variable, which see.
-
-If non-nil, these functions are called *instead* of the single
-function `autopair-default-handle-wrap-action', so use this
-variable to specify special behaviour. To also run the default
-behaviour, be sure to include `autopair-default-handle-wrap-action' in
-the list, or call it in your handlers.")
-(make-variable-buffer-local 'autopair-handle-wrap-action-fns)
-
-(defvar autopair-inserted nil
- "Delimiter inserted by last interactive autopair command.
-
-This is calculated with `autopair-calculate-inserted', which see.")
-
-(defun autopair-calculate-inserted ()
- "Attempts to guess the delimiter the current command is inserting.
-
-For now, simply returns `last-command-event'"
- last-command-event)
-
-;; minor mode and global mode
-;;
-(define-globalized-minor-mode autopair-global-mode autopair-mode autopair-on)
-
-(defun autopair-on () (unless (or buffer-read-only
- (if (functionp autopair-dont-activate)
- (funcall autopair-dont-activate)
- autopair-dont-activate))
- (autopair-mode 1)))
-
-(define-minor-mode autopair-mode
- "Automagically pair braces and quotes like in TextMate."
- nil " pair" nil
- (cond (autopair-mode
- ;; Setup the dynamic emulation keymap
- ;;
- (let ((map (make-sparse-keymap)))
- (define-key map [remap delete-backward-char] 'autopair-backspace)
- (define-key map [remap backward-delete-char-untabify] 'autopair-backspace)
- (define-key map (kbd "<backspace>") 'autopair-backspace)
- (define-key map [backspace] 'autopair-backspace)
- (define-key map (kbd "DEL") 'autopair-backspace)
- (define-key map [return] 'autopair-newline)
- (define-key map (kbd "RET") 'autopair-newline)
- (dotimes (char 256) ;; only searches the first 256 chars,
- ;; TODO: is this enough/toomuch/stupid?
- (unless (member char
- (getf autopair-dont-pair :never))
- (let* ((syntax-entry (aref (syntax-table) char))
- (class (and syntax-entry
- (syntax-class syntax-entry)))
- (pair (and syntax-entry
- (cdr syntax-entry))))
- (cond ((eq class (car (string-to-syntax "(")))
- ;; syntax classes "opening parens" and "close parens"
- (define-key map (string char) 'autopair-insert-opening)
- (define-key map (string pair) 'autopair-skip-close-maybe))
- ((eq class (car (string-to-syntax "\"")))
- ;; syntax class "string quote
- (define-key map (string char) 'autopair-insert-or-skip-quote))
- ((eq class (car (string-to-syntax "$")))
- ;; syntax class "paired-delimiter"
- ;;
- ;; Apropos this class, see Issues 18, 25 and
- ;; elisp info node "35.2.1 Table of Syntax
- ;; Classes". The fact that it supresses
- ;; syntatic properties in the delimited region
- ;; dictates that deciding to autopair/autoskip
- ;; can't really be as clean as the string
- ;; delimiter.
- ;;
- ;; Apparently, only `TeX-mode' uses this, so
- ;; the best is to bind this to
- ;; `autopair-insert-or-skip-paired-delimiter'
- ;; which defers any decision making to
- ;; mode-specific post-command handler
- ;; functions.
- ;;
- (define-key map (string char) 'autopair-insert-or-skip-paired-delimiter))))))
- ;; read `autopair-extra-pairs'
- (dolist (pairs-list (remove-if-not #'listp autopair-extra-pairs))
- (dolist (pair pairs-list)
- (define-key map (string (car pair)) 'autopair-extra-insert-opening)
- (define-key map (string (cdr pair)) 'autopair-extra-skip-close-maybe)))
-
- (set (make-local-variable 'autopair-emulation-alist) (list (cons t map))))
-
- (setq autopair-action nil)
- (setq autopair-wrap-action nil)
- (add-hook 'emulation-mode-map-alists 'autopair-emulation-alist 'append)
- (add-hook 'post-command-hook 'autopair-post-command-handler nil 'local))
- (t
- (setq autopair-emulation-alist nil)
- (remove-hook 'emulation-mode-map-alists 'autopair-emulation-alist)
- (remove-hook 'post-command-hook 'autopair-post-command-handler 'local))))
-
-;; helper functions
-;;
-(defun autopair-syntax-ppss ()
- "Calculate syntax info relevant to autopair.
-
-A list of four elements is returned:
-
-- SYNTAX-INFO is either the result `syntax-ppss' or the result of
- calling `parse-partial-sexp' with the appropriate
- bounds (previously calculated with `syntax-ppss'.
-
-- WHERE-SYM can be one of the symbols :string, :comment or :code.
-
-- QUICK-SYNTAX-INFO is always the result returned by `syntax-ppss'.
-
-- BOUNDS are the boudaries of the current string or comment if
- we're currently inside one."
- (let* ((quick-syntax-info (syntax-ppss))
- (string-or-comment-start (nth 8 quick-syntax-info)))
- (cond (;; inside a string, recalculate
- (nth 3 quick-syntax-info)
- (list (parse-partial-sexp (1+ string-or-comment-start) (point))
- :string
- quick-syntax-info
- (cons string-or-comment-start
- (condition-case nil
- (scan-sexps string-or-comment-start 1)
- (error nil)))))
- ((nth 4 quick-syntax-info)
- (list (parse-partial-sexp (1+ (nth 8 quick-syntax-info)) (point))
- :comment
- quick-syntax-info))
- (t
- (list quick-syntax-info
- :code
- quick-syntax-info)))))
-
-(defun autopair-find-pair (delim &optional closing)
- (when (and delim
- (integerp delim))
- (let ((syntax-entry (aref (syntax-table) delim)))
- (cond ((eq (syntax-class syntax-entry) (car (string-to-syntax "(")))
- (cdr syntax-entry))
- ((or (eq (syntax-class syntax-entry) (car (string-to-syntax "\"")))
- (eq (syntax-class syntax-entry) (car (string-to-syntax "$"))))
- delim)
- ((and (not closing)
- (eq (syntax-class syntax-entry) (car (string-to-syntax ")"))))
- (cdr syntax-entry))
- (autopair-extra-pairs
- (some #'(lambda (pair-list)
- (some #'(lambda (pair)
- (cond ((eq (cdr pair) delim) (car pair))
- ((eq (car pair) delim) (cdr pair))))
- pair-list))
- (remove-if-not #'listp autopair-extra-pairs)))))))
-
-(defun autopair-calculate-wrap-action ()
- (when (and transient-mark-mode mark-active)
- (when (> (point) (mark))
- (exchange-point-and-mark))
- (save-excursion
- (let* ((region-before (cons (region-beginning)
- (region-end)))
- (point-before (point))
- (start-syntax (syntax-ppss (car region-before)))
- (end-syntax (syntax-ppss (cdr region-before))))
- (when (or (not (eq autopair-autowrap 'help-balance))
- (and (eq (nth 0 start-syntax) (nth 0 end-syntax))
- (eq (nth 3 start-syntax) (nth 3 end-syntax))))
- (list 'wrap (or (second autopair-action)
- (autopair-find-pair autopair-inserted))
- point-before
- region-before))))))
-
-(defun autopair-original-binding ()
- (or (key-binding `[,autopair-inserted])
- (key-binding (this-single-command-keys))
- (key-binding fallback-keys)))
-
-(defun autopair-fallback (&optional fallback-keys)
- (let* ((autopair-emulation-alist nil)
- (beyond-cua (let ((cua--keymap-alist nil))
- (autopair-original-binding)))
- (beyond-autopair (autopair-original-binding)))
- (when autopair-autowrap
- (setq autopair-wrap-action (autopair-calculate-wrap-action)))
-
- (setq this-original-command beyond-cua)
- ;; defer to "paredit-mode" if that is installed and running
- (when (and (featurep 'paredit)
- (string-match "paredit" (symbol-name beyond-cua)))
- (setq autopair-action nil))
- (let ((cua-delete-selection (not autopair-autowrap))
- (blink-matching-paren (not autopair-action)))
- (call-interactively beyond-autopair))))
-
-(defvar autopair-autowrap 'help-balance
- "If non-nil autopair attempts to wrap the selected region.
-
-This is also done in an optimistic \"try-to-balance\" fashion.
-Set this to to 'help-balance to be more criterious when wrapping.")
-
-(defvar autopair-skip-whitespace nil
- "If non-nil also skip over whitespace when skipping closing delimiters.
-
-If set to 'chomp, this will be most useful in lisp-like languages where you want
-lots of )))))....")
-
-(defvar autopair-blink (if (boundp 'blink-matching-paren)
- blink-matching-paren
- t)
- "If non-nil autopair blinks matching delimiters.")
-
-(defvar autopair-blink-delay 0.1
- "Autopair's blink-the-delimiter delay.")
-
-(defun autopair-document-bindings (&optional fallback-keys)
- (concat
- "Works by scheduling possible autopair behaviour, then calls
-original command as if autopair didn't exist"
- (when (eq this-command 'describe-key)
- (let* ((autopair-emulation-alist nil)
- (command (or (key-binding (this-single-command-keys))
- (key-binding fallback-keys))))
- (when command
- (format ", which in this case is `%s'" command))))
- "."))
-
-(defun autopair-escaped-p (syntax-info)
- (nth 5 syntax-info))
-
-(defun autopair-exception-p (where-sym exception-where-sym blacklist &optional fn)
- (and (or (eq exception-where-sym :everywhere)
- (eq exception-where-sym where-sym))
- (member autopair-inserted
- (if fn
- (mapcar fn (getf blacklist exception-where-sym))
- (getf blacklist exception-where-sym)))))
-
-(defun autopair-up-list (syntax-info &optional closing)
- "Try to uplist as much as possible, moving point.
-
-Return nil if something prevented uplisting.
-
-Otherwise return a cons of char positions of the starting
-delimiter and end delimiters of the last list we just came out
-of. If we aren't inside any lists return a cons of current point.
-
-If inside nested lists of mixed parethesis types, finding a
-matching parenthesis of a mixed-type is considered OK (non-nil is
-returned) and uplisting stops there."
- (condition-case nil
- (let ((howmany (car syntax-info))
- (retval (cons (point)
- (point))))
- (while (and (> howmany 0)
- (condition-case err
- (progn
- (scan-sexps (point) (- (point-max)))
- (error err))
- (error (let ((opening (and closing
- (autopair-find-pair closing))))
- (setq retval (cons (fourth err)
- (point)))
- (or (not opening)
- (eq opening (char-after (fourth err))))))))
- (goto-char (scan-lists (point) 1 1))
- (decf howmany))
- retval)
- (error nil)))
-
-;; interactive commands and their associated predicates
-;;
-(defun autopair-insert-or-skip-quote ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (let* ((syntax-triplet (autopair-syntax-ppss))
- (syntax-info (first syntax-triplet))
- (where-sym (second syntax-triplet))
- (orig-info (third syntax-triplet))
- ;; inside-string may the quote character itself or t if this
- ;; is a "generically terminated string"
- (inside-string (and (eq where-sym :string)
- (fourth orig-info)))
- (escaped-p (autopair-escaped-p syntax-info))
-
- )
- (cond (;; decides whether to skip the quote...
- ;;
- (and (not escaped-p)
- (eq autopair-inserted (char-after (point)))
- (or
- ;; ... if we're already inside a string and the
- ;; string starts with the character just inserted,
- ;; or it's a generically terminated string
- (and inside-string
- (or (eq inside-string t)
- (eq autopair-inserted inside-string)))
- ;; ... if we're in a comment and ending a string
- ;; (the inside-string criteria does not work
- ;; here...)
- (and (eq where-sym :comment)
- (condition-case nil
- (eq autopair-inserted (char-after (scan-sexps (1+ (point)) -1)))
- (error nil)))))
- (setq autopair-action (list 'skip-quote autopair-inserted (point))))
- (;; decides whether to pair, i.e do *not* pair the quote if...
- ;;
- (not
- (or
- escaped-p
- ;; ... inside a generic string
- (eq inside-string t)
- ;; ... inside an unterminated string started by this char
- (autopair-in-unterminated-string-p syntax-triplet)
- ;; ... uplisting forward causes an error which leaves us
- ;; inside an unterminated string started by this char
- (condition-case err
- (progn (save-excursion (up-list)) nil)
- (error
- (autopair-in-unterminated-string-p (save-excursion
- (goto-char (fourth err))
- (autopair-syntax-ppss)))))
- (autopair-in-unterminated-string-p (save-excursion
- (goto-char (point-max))
- (autopair-syntax-ppss)))
- ;; ... comment-disable or string-disable are true here.
- ;; The latter is only useful if we're in a string
- ;; terminated by a character other than
- ;; `autopair-inserted'.
- (some #'(lambda (sym)
- (autopair-exception-p where-sym sym autopair-dont-pair))
- '(:comment :string))))
- (setq autopair-action (list 'insert-quote autopair-inserted (point)))))
- (autopair-fallback)))
-
-(put 'autopair-insert-or-skip-quote 'function-documentation
- '(concat "Insert or possibly skip over a quoting character.\n\n"
- (autopair-document-bindings)))
-
-(defun autopair-in-unterminated-string-p (autopair-triplet)
- (and (eq autopair-inserted (fourth (third autopair-triplet)))
- (condition-case nil (progn (scan-sexps (ninth (third autopair-triplet)) 1) nil) (error t))))
-
-
-(defun autopair-insert-opening ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (when (autopair-pair-p)
- (setq autopair-action (list 'opening (autopair-find-pair autopair-inserted) (point))))
- (autopair-fallback))
-(put 'autopair-insert-opening 'function-documentation
- '(concat "Insert opening delimiter and possibly automatically close it.\n\n"
- (autopair-document-bindings)))
-
-(defun autopair-skip-close-maybe ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (when (autopair-skip-p)
- (setq autopair-action (list 'closing (autopair-find-pair autopair-inserted) (point))))
- (autopair-fallback))
-(put 'autopair-skip-close-maybe 'function-documentation
- '(concat "Insert or possibly skip over a closing delimiter.\n\n"
- (autopair-document-bindings)))
-
-(defun autopair-backspace ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (when (char-before)
- (setq autopair-action (list 'backspace (autopair-find-pair (char-before) 'closing) (point))))
- (autopair-fallback (kbd "DEL")))
-(put 'autopair-backspace 'function-documentation
- '(concat "Possibly delete a pair of paired delimiters.\n\n"
- (autopair-document-bindings (kbd "DEL"))))
-
-(defun autopair-newline ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (let ((pair (autopair-find-pair (char-before))))
- (when (and pair
- (eq (char-syntax pair) ?\))
- (eq (char-after) pair))
- (setq autopair-action (list 'newline pair (point))))
- (autopair-fallback (kbd "RET"))))
-(put 'autopair-newline 'function-documentation
- '(concat "Do a smart newline when right between parenthesis.\n
-In other words, insert an extra newline along with the one inserted normally
-by this command. Then place point after the first, indented.\n\n"
- (autopair-document-bindings (kbd "RET"))))
-
-(defun autopair-skip-p ()
- (let* ((syntax-triplet (autopair-syntax-ppss))
- (syntax-info (first syntax-triplet))
- (orig-point (point)))
- (cond ((eq autopair-skip-criteria 'help-balance)
- (save-excursion
- (let ((pos-pair (autopair-up-list syntax-info autopair-inserted)))
- ;; if `autopair-up-list' returned something valid, we
- ;; probably want to skip but only if on of the following is true.
- ;;
- ;; 1. it returned a cons of equal values (we're not inside any list
- ;;
- ;; 2. up-listing stopped at a list that contains our original point
- ;;
- ;; 3. up-listing stopped at a list that does not
- ;; contain out original point but its starting
- ;; delimiter matches the one we expect.
- (and pos-pair
- (or (eq (car pos-pair) (cdr pos-pair))
- (< orig-point (cdr pos-pair))
- (eq (char-after (car pos-pair))
- (autopair-find-pair autopair-inserted)))))))
- ((eq autopair-skip-criteria 'need-opening)
- (save-excursion
- (condition-case err
- (progn
- (backward-list)
- t)
- (error nil))))
- (t
- t))))
-
-(defun autopair-pair-p ()
- (let* ((syntax-triplet (autopair-syntax-ppss))
- (syntax-info (first syntax-triplet))
- (where-sym (second syntax-triplet))
- (orig-point (point)))
- (and (not (some #'(lambda (sym)
- (autopair-exception-p where-sym sym autopair-dont-pair))
- '(:string :comment :code :everywhere)))
- (cond ((eq autopair-pair-criteria 'help-balance)
- (and (not (autopair-escaped-p syntax-info))
- (save-excursion
- (let ((pos-pair (autopair-up-list syntax-info))
- (prev-point (point-max))
- (expected-closing (autopair-find-pair autopair-inserted)))
- (condition-case err
- (progn
- (while (not (eq prev-point (point)))
- (setq prev-point (point))
- (forward-sexp))
- t)
- (error
- ;; if `forward-sexp' (called byp
- ;; `autopair-forward') returned an error.
- ;; typically we don't want to autopair,
- ;; unless one of the following occurs:
- ;;
- (cond (;; 1. The error is *not* of type "containing
- ;; expression ends prematurely", which means
- ;; we're in the "too-many-openings" situation
- ;; and thus want to autopair.
- (not (string-match "prematurely" (second err)))
- t)
- (;; 2. We stopped at a closing parenthesis. Do
- ;; autopair if we're in a mixed parens situation,
- ;; i.e. the last list jumped over was started by
- ;; the paren we're trying to match
- ;; (`autopair-inserted') and ended by a different
- ;; parens, or the closing paren we stopped at is
- ;; also different from the expected. The second
- ;; `scan-lists' places point at the closing of the
- ;; last list we forwarded over.
- ;;
- (condition-case err
- (prog1
- (eq (char-after (scan-lists (point) -1 0))
- autopair-inserted)
- (goto-char (scan-lists (point) -1 -1)))
- (error t))
-
- (or
- ;; mixed () ] for input (, yes autopair
- (not (eq expected-closing (char-after (third err))))
- ;; mixed (] ) for input (, yes autopair
- (not (eq expected-closing (char-after (point))))
- ;; ()) for input (, not mixed
- ;; hence no autopair
- ))
- (t
- nil))
- ;; (eq (fourth err) (point-max))
- ))))))
- ((eq autopair-pair-criteria 'always)
- t)
- (t
- (not (autopair-escaped-p)))))))
-
-;; post-command-hook stuff
-;;
-(defun autopair-post-command-handler ()
- "Performs pairing and wrapping based on `autopair-action' and
-`autopair-wrap-action'. "
- (when (and autopair-wrap-action
- (notany #'null autopair-wrap-action))
-
- (if autopair-handle-wrap-action-fns
- (condition-case err
- (mapc #'(lambda (fn)
- (apply fn autopair-wrap-action))
- autopair-handle-wrap-action-fns)
- (error (progn
- (message "[autopair] error running custom `autopair-handle-wrap-action-fns', switching autopair off")
- (autopair-mode -1))))
- (apply #'autopair-default-handle-wrap-action autopair-wrap-action))
- (setq autopair-wrap-action nil))
-
- (when (and autopair-action
- (notany #'null autopair-action))
- (if autopair-handle-action-fns
- (condition-case err
- (mapc #'(lambda (fn)
- (funcall fn (first autopair-action) (second autopair-action) (third autopair-action)))
- autopair-handle-action-fns)
- (error (progn
- (message "[autopair] error running custom `autopair-handle-action-fns', switching autopair off")
- (autopair-mode -1))))
- (apply #'autopair-default-handle-action autopair-action))
- (setq autopair-action nil)))
-
-(defun autopair-blink-matching-open ()
- (let ((blink-matching-paren autopair-blink)
- (show-paren-mode nil)
- (blink-matching-delay autopair-blink-delay))
- (blink-matching-open)))
-
-(defun autopair-blink (&optional pos)
- (when autopair-blink
- (if pos
- (save-excursion
- (goto-char pos)
- (sit-for autopair-blink-delay))
- (sit-for autopair-blink-delay))))
-
-(defun autopair-default-handle-action (action pair pos-before)
- ;;(message "action is %s" action)
- (condition-case err
- (cond (;; automatically insert closing delimiter
- (and (eq 'opening action)
- (not (eq pair (char-before))))
- (insert pair)
- (autopair-blink)
- (backward-char 1))
- (;; automatically insert closing quote delimiter
- (eq 'insert-quote action)
- (insert pair)
- (autopair-blink)
- (backward-char 1))
- (;; automatically skip oper closer quote delimiter
- (and (eq 'skip-quote action)
- (eq pair (char-after (point))))
- (delete-char 1)
- (autopair-blink-matching-open))
- (;; skip over newly-inserted-but-existing closing delimiter
- ;; (normal case)
- (eq 'closing action)
- (let ((skipped 0))
- (when autopair-skip-whitespace
- (setq skipped (save-excursion (skip-chars-forward "\s\n\t"))))
- (when (eq autopair-inserted (char-after (+ (point) skipped)))
- (backward-delete-char 1)
- (unless (zerop skipped) (autopair-blink (+ (point) skipped)))
- (if (eq autopair-skip-whitespace 'chomp)
- (delete-char skipped)
- (forward-char skipped))
- (forward-char))
- (autopair-blink-matching-open)))
- (;; autodelete closing delimiter
- (and (eq 'backspace action)
- (eq pair (char-after (point))))
- (delete-char 1))
- (;; opens an extra line after point, then indents
- (and (eq 'newline action)
- (eq pair (char-after (point))))
- (save-excursion
- (newline-and-indent))
- (indent-according-to-mode)
- (when (or (and (boundp 'global-hl-line-mode)
- global-hl-line-mode)
- (and (boundp 'hl-line-mode)
- hl-line-mode))
- (hl-line-unhighlight) (hl-line-highlight))))
- (error
- (message "[autopair] Ignored error in `autopair-default-handle-action'"))))
-
-(defun autopair-default-handle-wrap-action (action pair pos-before region-before)
- "Default handler for the wrapping action in `autopair-wrap'"
- (condition-case err
- (when (eq 'wrap action)
- (let ((delete-active-region nil))
- (cond
- ((eq 'opening (first autopair-action))
- (goto-char (1+ (cdr region-before)))
- (insert pair)
- (autopair-blink)
- (goto-char (1+ (car region-before))))
- (;; wraps
- (eq 'closing (first autopair-action))
- (delete-backward-char 1)
- (insert pair)
- (goto-char (1+ (cdr region-before)))
- (insert autopair-inserted))
- ((eq 'insert-quote (first autopair-action))
- (goto-char (1+ (cdr region-before)))
- (insert pair)
- (autopair-blink))
- (t
- (delete-backward-char 1)
- (goto-char (cdr region-before))
- (insert autopair-inserted)))
- (setq autopair-action nil)))
- (error
- (message "[autopair] Ignored error in `autopair-default-handle-wrap-action'"))))
-
-
-;; example python triple quote helper
-;;
-(defun autopair-python-triple-quote-action (action pair pos-before)
- (cond ((and (eq 'insert-quote action)
- (>= (point) 3)
- (string= (buffer-substring (- (point) 3)
- (point))
- (make-string 3 pair)))
- (save-excursion (insert (make-string 2 pair))))
- ((and (eq 'backspace action)
- (>= (point) 2)
- (<= (point) (- (point-max) 2))
- (string= (buffer-substring (- (point) 2)
- (+ (point) 2))
- (make-string 4 pair)))
- (delete-region (- (point) 2)
- (+ (point) 2)))
- ((and (eq 'skip-quote action)
- (<= (point) (- (point-max) 2))
- (string= (buffer-substring (point)
- (+ (point) 2))
- (make-string 2 pair)))
- (forward-char 2))
- (t
- t)))
-
-;; example latex paired-delimiter helper
-;;
-(defun autopair-latex-mode-paired-delimiter-action (action pair pos-before)
- "Pair or skip latex's \"paired delimiter\" syntax in math mode. Added AucText support, thanks Massimo Lauria"
- (when (eq action 'paired-delimiter)
- (when (eq (char-before) pair)
- (if (and (or
- (eq (get-text-property pos-before 'face) 'tex-math)
- (eq (get-text-property (- pos-before 1) 'face) 'font-latex-math-face)
- (member 'font-latex-math-face (get-text-property (- pos-before 1) 'face)))
- (eq (char-after) pair))
- (cond ((and (eq (char-after) pair)
- (eq (char-after (1+ (point))) pair))
- ;; double skip
- (delete-char 1)
- (forward-char))
- ((eq (char-before pos-before) pair)
- ;; doube insert
- (insert pair)
- (backward-char))
- (t
- ;; simple skip
- (delete-char 1)))
- (insert pair)
- (backward-char)))))
-
-;; Commands and predicates for the autopair-extra* feature
-;;
-
-(defun autopair-extra-insert-opening ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (when (autopair-extra-pair-p)
- (setq autopair-action (list 'opening (autopair-find-pair autopair-inserted) (point))))
- (autopair-fallback))
-(put 'autopair-extra-insert-opening 'function-documentation
- '(concat "Insert (an extra) opening delimiter and possibly automatically close it.\n\n"
- (autopair-document-bindings)))
-
-(defun autopair-extra-skip-close-maybe ()
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (when (autopair-extra-skip-p)
- (setq autopair-action (list 'closing autopair-inserted (point))))
- (autopair-fallback))
-(put 'autopair-extra-skip-close-maybe 'function-documentation
- '(concat "Insert or possibly skip over a (and extra) closing delimiter.\n\n"
- (autopair-document-bindings)))
-
-(defun autopair-extra-pair-p ()
- (let* ((syntax-triplet (autopair-syntax-ppss))
- (syntax-info (first syntax-triplet))
- (where-sym (second syntax-triplet)))
- (some #'(lambda (sym)
- (autopair-exception-p where-sym sym autopair-extra-pairs #'car))
- '(:everywhere :comment :string :code))))
-
-(defun autopair-extra-skip-p ()
- (let* ((syntax-triplet (autopair-syntax-ppss))
- (syntax-info (first syntax-triplet))
- (where-sym (second syntax-triplet))
- (orig-point (point)))
- (and (eq (char-after (point)) autopair-inserted)
- (some #'(lambda (sym)
- (autopair-exception-p where-sym sym autopair-extra-pairs #'cdr))
- '(:comment :string :code :everywhere))
- (save-excursion
- (condition-case err
- (backward-sexp (point-max))
- (error
- (goto-char (third err))))
- (search-forward (make-string 1 (autopair-find-pair autopair-inserted))
- orig-point
- 'noerror)))))
-
-;; Commands and tex-mode specific handler functions for the "paired
-;; delimiter" syntax class.
-;;
-(defun autopair-insert-or-skip-paired-delimiter ()
- " insert or skip a character paired delimiter"
- (interactive)
- (setq autopair-inserted (autopair-calculate-inserted))
- (setq autopair-action (list 'paired-delimiter autopair-inserted (point)))
- (autopair-fallback))
-
-(put 'autopair-insert-or-skip-paired-delimiter 'function-documentation
- '(concat "Insert or possibly skip over a character with a syntax-class of \"paired delimiter\"."
- (autopair-document-bindings)))
-
-
-
-;; monkey-patching: Compatibility with delete-selection-mode and cua-mode
-;;
-;; Ideally one would be able to use functions as the value of the
-;; 'delete-selection properties of the autopair commands. The function
-;; would return non-nil when no wrapping should/could be performed.
-;;
-;; Until then use some `defadvice' i.e. monkey-patching, which relies
-;; on these features' implementation details.
-;;
-(put 'autopair-insert-opening 'delete-selection t)
-(put 'autopair-skip-close-maybe 'delete-selection t)
-(put 'autopair-insert-or-skip-quote 'delete-selection t)
-(put 'autopair-extra-insert-opening 'delete-selection t)
-(put 'autopair-extra-skip-close-maybe 'delete-selection t)
-(put 'autopair-backspace 'delete-selection 'supersede)
-(put 'autopair-newline 'delete-selection t)
-
-(defun autopair-should-autowrap ()
- (let ((name (symbol-name this-command)))
- (and autopair-mode
- (not (eq this-command 'autopair-backspace))
- (string-match "^autopair" (symbol-name this-command))
- (autopair-calculate-wrap-action))))
-
-(defadvice cua--pre-command-handler-1 (around autopair-override activate)
- "Don't actually do anything if autopair is about to autowrap. "
- (unless (autopair-should-autowrap) ad-do-it))
-
-(defadvice delete-selection-pre-hook (around autopair-override activate)
- "Don't actually do anything if autopair is about to autowrap. "
- (unless (autopair-should-autowrap) ad-do-it))
-
-
-(provide 'autopair)
-;;; autopair.el ends here
-;;
View
21 vendor/compile.sh
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-dir=`dirname $0`
-
-(cd $dir/evil && make)
-(cd $dir/magit && make)
-
-if type rake > /dev/null 2>&1; then
- (cd $dir/yasnippet && rake compile)
-fi
-
-emacs --batch -Q -f batch-byte-compile $dir/ace-jump-mode.el
-emacs --batch -Q -f batch-byte-compile $dir/autopair.el
-emacs --batch -Q -f batch-byte-compile $dir/browse-kill-ring.el
-emacs --batch -Q -f batch-byte-compile $dir/color-theme.el
-emacs --batch -Q -f batch-byte-compile $dir/csharp-mode-0.8.5.el
-emacs --batch -Q -f batch-byte-compile $dir/hide-region.el
-emacs --batch -Q -f batch-byte-compile $dir/idomenu.el
-emacs --batch -Q -f batch-byte-compile $dir/smart-tab/smart-tab.el
-emacs --batch -Q -f batch-byte-compile $dir/xcscope.el
-
View
21 vendor/etags-select.el
@@ -325,7 +325,7 @@ to do."
Use the C-u prefix to prevent the etags-select window from closing."
(interactive "P")
(let ((case-fold-search (etags-select-case-fold-search))
- tagname tag-point text-to-search-for filename filename-point (search-count 1))
+ tagname tag-point text-to-search-for filename filename-point (search-count 1) multiple-tag)
(save-excursion
(goto-char (point-min))
(re-search-forward "Finding tag: \\(.*\\)$")
@@ -336,7 +336,7 @@ Use the C-u prefix to prevent the etags-select window from closing."
(setq tag-point (point))
(setq overlay-arrow-position (point-marker))
(re-search-forward "\\]\\s-+\\(.+?\\)\\s-*$")
- (setq text-to-search-for (regexp-quote (etags-select-match-string 1)))
+ (setq text-to-search-for (concat (regexp-quote (etags-select-match-string 1)) "$"))
(goto-char tag-point)
(re-search-backward "^In: \\(.*\\)$")
(setq filename (etags-select-match-string 1))
@@ -344,6 +344,10 @@ Use the C-u prefix to prevent the etags-select window from closing."
(goto-char tag-point)
(while (re-search-backward (concat "^.*?\\]\\s-+" text-to-search-for) filename-point t)
(setq search-count (1+ search-count)))
+ (when (or (> search-count 1)
+ (end-of-line)
+ (re-search-forward (concat "^.*?\\]\\s-+" text-to-search-for) (point-max) t))
+ (setq multiple-tag t))
(goto-char tag-point)
(unless arg
(kill-buffer etags-select-buffer-name)
@@ -358,11 +362,14 @@ Use the C-u prefix to prevent the etags-select window from closing."
(find-file-other-window filename)
(find-file filename))
(goto-char (point-min))
- (while (> search-count 0)
- (unless (re-search-forward (concat "^\\s-*" text-to-search-for) nil t)
- (message "TAGS file out of date ... stopping at closest match")
- (setq search-count 1))
- (setq search-count (1- search-count)))
+ (if (and (not multiple-tag) (eq search-count 1))
+ (while (re-search-forward (concat "^\\s-*" text-to-search-for) nil t)
+ (ignore multiple-tag))
+ (while (> search-count 0)
+ (unless (re-search-forward (concat "^\\s-*" text-to-search-for) nil t)
+ (message "TAGS file out of date ... stopping at closest match")
+ (setq search-count 1))
+ (setq search-count (1- search-count))))
(beginning-of-line)
(re-search-forward tagname)
(goto-char (match-beginning 0))
2 vendor/evil
@@ -1 +1 @@
-Subproject commit 38caa7340a0c188c52a3a3bc693412dc77c0e766
+Subproject commit 64a8b308fbe845b8de7e6862c4f8674262ed9ad1
2 vendor/magit
@@ -1 +1 @@
-Subproject commit 287ee9a5fa4519c4806b61d1f6cba682d49d8711
+Subproject commit fd215cb36359888f8635c242aa0bf500f635e69a
View
10 winfred-buffer.el
@@ -4,6 +4,8 @@
auto-save-list-file-prefix "~/.d.emacs.d/auto-save-list/.saves-"
require-final-newline t)
+(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
+
;; bookmarks file and autosaving
(setq bookmark-default-file "~/.d.emacs.d/bookmarks"
bookmark-save-flag 1)
@@ -35,10 +37,10 @@
(defun wf-ido-ignore-buf (name)
(with-current-buffer name (not buffer-file-name)))
(setq ido-ignore-buffers '("^ " wf-ido-ignore-buf))
-(loop for d in '("\\`auto" "\\`backups/" "\\`CVS/")
- do (add-to-list 'ido-ignore-directories d))
-(loop for f in '("tags" "\\`cscope." "\\.dep$" ".d.emacs.d" ".dropbox")
- do (add-to-list 'ido-ignore-files f))
+(dolist (d '("\\`auto" "\\`backups/" "\\`CVS/"))
+ (add-to-list 'ido-ignore-directories d))
+(dolist (f '("tags" "\\`cscope." "\\.dep$" ".d.emacs.d" ".dropbox"))
+ (add-to-list 'ido-ignore-files f))
;;;;;;
View
138 winfred-color-theme.el
@@ -115,3 +115,141 @@
(underline ((t (:underline t))))
(zmacs-region ((t (:background "dark slate gray")))))))
+
+(defun color-theme-jsc-light ()
+ "Color theme by John S Cooper, created 2000-06-08."
+ (interactive)
+ (color-theme-install
+ '(color-theme-jsc-light
+ ((background-color . "white")
+ (background-mode . light)
+ (border-color . "black")
+ (cursor-color . "Red")
+ (foreground-color . "black")
+ (mouse-color . "black"))
+ ((gnus-mouse-face . highlight)
+ (list-matching-lines-face . bold)
+ (view-highlight-face . highlight))
+ (default ((t (nil))))
+ (bold ((t (:bold t :foreground "red3"))))
+ (bold-italic ((t (:italic t :bold t :foreground "red"))))
+ (custom-button-face ((t (nil))))
+ (custom-changed-face ((t (:background "blue" :foreground "white"))))
+ (custom-documentation-face ((t (nil))))
+ (custom-face-tag-face ((t (:underline t))))
+ (custom-group-tag-face ((t (:underline t :foreground "blue"))))
+ (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
+ (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
+ (custom-modified-face ((t (:background "blue" :foreground "white"))))
+ (custom-rogue-face ((t (:background "black" :foreground "pink"))))
+ (custom-saved-face ((t (:underline t))))
+ (custom-set-face ((t (:background "white" :foreground "blue"))))
+ (custom-state-face ((t (:foreground "dark green"))))
+ (custom-variable-button-face ((t (:underline t :bold t))))
+ (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
+ (font-lock-builtin-face ((t (:foreground "Orchid"))))
+ (font-lock-comment-face ((t (:italic t :bold t :foreground "Red3"))))
+ (font-lock-constant-face ((t (:foreground "navy"))))
+ (font-lock-function-name-face ((t (:bold t :foreground "Blue"))))
+ (font-lock-keyword-face ((t (:bold t :foreground "Purple"))))
+ (font-lock-string-face ((t (:foreground "Green4"))))
+ (font-lock-type-face ((t (:foreground "Navy"))))
+ (font-lock-variable-name-face ((t (:foreground "Tan4"))))
+ (font-lock-warning-face ((t (:bold t :foreground "Red"))))
+ (gnus-cite-attribution-face ((t (:italic t))))
+ (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
+ (gnus-cite-face-10 ((t (:foreground "medium purple"))))
+ (gnus-cite-face-11 ((t (:foreground "turquoise"))))
+ (gnus-cite-face-2 ((t (:foreground "firebrick"))))
+ (gnus-cite-face-3 ((t (:foreground "dark green"))))
+ (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
+ (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
+ (gnus-cite-face-6 ((t (:foreground "dark violet"))))
+ (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
+ (gnus-cite-face-8 ((t (:foreground "magenta"))))
+ (gnus-cite-face-9 ((t (:foreground "violet"))))
+ (gnus-emphasis-bold ((t (:bold t))))
+ (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
+ (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
+ (gnus-emphasis-italic ((t (:italic t))))
+ (gnus-emphasis-underline ((t (:underline t))))
+ (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
+ (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
+ (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
+ (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
+ (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
+ (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
+ (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
+ (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
+ (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
+ (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
+ (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
+ (gnus-group-news-1-empty-face ((t (:foreground "blue2"))))
+ (gnus-group-news-1-face ((t (:bold t :foreground "blue2"))))
+ (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
+ (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
+ (gnus-group-news-3-empty-face ((t (nil))))
+ (gnus-group-news-3-face ((t (:bold t))))
+ (gnus-group-news-4-empty-face ((t (nil))))
+ (gnus-group-news-4-face ((t (:bold t))))
+ (gnus-group-news-5-empty-face ((t (nil))))
+ (gnus-group-news-5-face ((t (:bold t))))
+ (gnus-group-news-6-empty-face ((t (nil))))
+ (gnus-group-news-6-face ((t (:bold t))))
+ (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
+ (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
+ (gnus-header-content-face ((t (:italic t :foreground "blue"))))
+ (gnus-header-from-face ((t (:foreground "red3"))))
+ (gnus-header-name-face ((t (:foreground "red3"))))
+ (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue"))))
+ (gnus-header-subject-face ((t (:bold t :foreground "red"))))
+ (gnus-signature-face ((t (:foreground "pink"))))
+ (gnus-splash-face ((t (:foreground "Brown"))))
+ (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
+ (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
+ (gnus-summary-high-read-face ((t (:bold t :foreground "navy"))))
+ (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
+ (gnus-summary-high-unread-face ((t (:bold t :foreground "blue"))))
+ (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
+ (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
+ (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
+ (gnus-summary-low-unread-face ((t (:italic t))))
+ (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
+ (gnus-summary-normal-read-face ((t (:foreground "red3"))))
+ (gnus-summary-normal-ticked-face ((t (:foreground "black"))))
+ (gnus-summary-normal-unread-face ((t (:bold t :foreground "red3"))))
+ (gnus-summary-selected-face ((t (:underline t))))
+ (highlight ((t (:background "antiquewhite" :foreground "blue"))))
+ (italic ((t (:italic t))))
+ (makefile-space-face ((t (:background "hotpink"))))
+ (message-cited-text-face ((t (:foreground "red"))))
+ (message-header-cc-face ((t (:foreground "MidnightBlue"))))
+ (message-header-name-face ((t (:foreground "cornflower blue"))))
+ (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
+ (message-header-other-face ((t (:foreground "steel blue"))))
+ (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
+ (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
+ (message-header-xheader-face ((t (:foreground "blue"))))
+ (message-mml-face ((t (:foreground "ForestGreen"))))
+ (message-separator-face ((t (:foreground "brown"))))
+ (modeline ((t (:background "plum" :foreground "black"))))
+ (modeline-buffer-id ((t (:background "plum" :foreground "black"))))
+ (modeline-mousable ((t (:background "plum" :foreground "black"))))
+ (modeline-mousable-minor-mode ((t (:background "plum" :foreground "black"))))
+ (region ((t (:background "plum"))))
+ (secondary-selection ((t (:background "palegreen"))))
+ (show-paren-match-face ((t (:background "plum"))))
+ (show-paren-mismatch-face ((t (:background "navy" :foreground "white"))))
+ (speedbar-button-face ((t (:foreground "green4"))))
+ (speedbar-directory-face ((t (:foreground "blue4"))))
+ (speedbar-file-face ((t (:foreground "cyan4"))))
+ (speedbar-highlight-face ((t (:background "green"))))
+ (speedbar-selected-face ((t (:underline t :foreground "red"))))
+ (speedbar-tag-face ((t (:foreground "brown"))))
+ (underline ((t (:underline t))))
+ (widget-button-face ((t (:bold t))))
+ (widget-button-pressed-face ((t (:foreground "red"))))
+ (widget-documentation-face ((t (:foreground "dark green"))))
+ (widget-field-face ((t (:background "gray85"))))
+ (widget-inactive-face ((t (:foreground "dim gray"))))
+ (widget-single-line-field-face ((t (:background "gray85")))))))
View
82 winfred-evil.el
@@ -13,13 +13,13 @@
evil-replace-state-tag (propertize "r" 'face '((:foreground "red"))))
(evil-mode 1)
-(loop for (mode . state) in '((calendar-mode . emacs)
- (cscope-list-entry-mode . emacs)
- (Custom-mode . normal)
- (grep-mode . emacs)
- (hexl-mode . emacs)
- (picture-mode . emacs))
- do (evil-set-initial-state mode state))
+(dolist (x '((calendar-mode . emacs)
+ (cscope-list-entry-mode . emacs)
+ (Custom-mode . normal)
+ (grep-mode . emacs)
+ (hexl-mode . emacs)
+ (picture-mode . emacs)))
+ (evil-set-initial-state (car x) (cdr x)))
;; kj as escape to return to normal mode
(define-key evil-insert-state-map "k" #'cofi/maybe-exit)
@@ -120,61 +120,6 @@
(define-key evil-normal-state-map "\C-]" 'etags-select-find-tag-at-point)
(define-key evil-normal-state-map "\M-." 'etags-select-find-tag)
-(defun wf-jump-item ()
- "An enhancement to evil-jump-item (%) for c-mode.
-It is able to jump between comments or conditionals."
- (interactive)
- (cond
- ((and (not (string= major-mode "c-mode"))
- (not (string= major-mode "c++-mode")))
- (evil-jump-item))
- ((or (and (char-equal (preceding-char) ?/)
- (char-equal (following-char) ?*))
- (and (char-equal (following-char) ?/)
- (char-equal (char-after (+ 1 (point))) ?*)))
- (search-forward "*/"))
- ((or (and (char-equal (preceding-char) ?*)
- (char-equal (following-char) ?/))
- (and (char-equal (following-char) ?*)
- (char-equal (char-after (+ 1 (point))) ?/)))
- (search-backward "/*"))
- ((string-match "^[ \t]*#[ \t]*\\(if\\|elif\\|else\\)" (thing-at-point 'line))
- (progn
- (when (fboundp 'hide-ifdef-mode)
- (hide-ifdef-mode 1))
- (hif-find-next-relevant)
- (while (hif-looking-at-ifX)
- (hif-ifdef-to-endif)
- (hif-find-next-relevant))))
- ((string-match "^[ \t]*#[ \t]*endif" (thing-at-point 'line))
- (progn
- (when (fboundp 'hide-ifdef-mode)
- (hide-ifdef-mode 1))
- (hif-endif-to-ifdef)))
- (t (evil-jump-item))))
-
-(defun wf-close-fold ()
- "An enhancement to evil-close-fold (zc) for c-mode to be able to hide conditionals."
- (interactive)
- (if (string-match "^[ \t]*#[ \t]*\\(if\\|elif\\|else\\|endif\\)"
- (thing-at-point 'line))
- (progn (when (fboundp 'hide-ifdef-mode)
- (hide-ifdef-mode 1))
- (when (fboundp 'hide-ifdef-block)
- (hide-ifdef-block)))
- (evil-close-fold)))
-
-(defun wf-open-fold ()
- "An enhancement to evil-open-fold (zc) for c-mode to be able to show the hidden conditionals."
- (interactive)
- (if (string-match "^[ \t]*#[ \t]*\\(if\\|elif\\|else\\|endif\\)"
- (thing-at-point 'line))
- (progn (when (fboundp 'hide-ifdef-mode)
- (hide-ifdef-mode 1))
- (when (fboundp 'show-ifdef-block)
- (show-ifdef-block)))
- (evil-open-fold)))
-
;;;;;; key bindings according to major mode ;;;;;;
@@ -184,12 +129,6 @@ It is able to jump between comments or conditionals."
"J" 'bookmark-bmenu-this-window
"K" 'bookmark-bmenu-delete)))
-(add-hook 'c-mode-common-hook
- '(lambda ()
- (define-key evil-motion-state-map "%" 'wf-jump-item)
- (define-key evil-normal-state-map "zo" 'wf-open-fold)
- (define-key evil-normal-state-map "zc" 'wf-close-fold)))
-
(eval-after-load "browse-kill-ring"
'(progn
(evil-define-key 'emacs browse-kill-ring-mode-map
@@ -220,6 +159,13 @@ It is able to jump between comments or conditionals."
'(progn
(evil-make-overriding-map custom-mode-map 'normal t)))
+(eval-after-load "dired"
+ '(progn
+ (evil-define-key 'normal dired-mode-map (kbd "^")
+ (lambda () (interactive) (find-alternate-file "..")))
+ (evil-define-key 'normal dired-mode-map (kbd "RET")
+ `dired-find-alternate-file)))
+
(eval-after-load "etags-select"
'(progn
(wf-define-evil-movements etags-select-mode-map
View
4 winfred-visual.el
@@ -2,6 +2,7 @@
(require 'color-theme)
(load-library "winfred-color-theme")
(color-theme-winfred)
+;(tty-run-terminal-initialization (selected-frame) "rxvt")
;; Don't show the startup screen, menu bar, tool bar, and scroll bar
(setq inhibit-startup-message t)
@@ -11,6 +12,7 @@
(setq line-number-mode t)
(setq column-number-mode t)
+(if (not indicate-empty-lines) (toggle-indicate-empty-lines))
;; Eighty column
(setq-default fill-column 80)
@@ -24,7 +26,6 @@
(setq visible-bell t)
;; Indent Tabs
-(if (not indicate-empty-lines) (toggle-indicate-empty-lines))
(setq-default indent-tabs-mode nil)
;; Enable narrow-to-region
@@ -42,3 +43,4 @@
mode
'(("\\<\\(FIXME\\)\\>" 1 font-lock-warning-face t))))
fixme-modes))
+

No commit comments for this range

Something went wrong with that request. Please try again.