Changeset 28807 for lang/elisp
- Timestamp:
- 01/22/09 05:37:07 (4 years ago)
- Files:
-
- 1 modified
-
lang/elisp/anything-c-erc/trunk/anything-c-erc.el (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/anything-c-erc/trunk/anything-c-erc.el
r28793 r28807 30 30 ;; M-x anything-c-erc 31 31 32 ;; to complete Nick name 33 ;; M-x anything-c-erc-complete-nick 32 34 33 35 (require 'anything) 34 36 (require 'erc) 35 37 38 39 ;;; Advice 40 41 (defvar anything-c-erc-nicks nil 42 "list of nicknames. each nickname can be started with \"@\"") 43 (make-variable-buffer-local 'anything-c-erc-nicks) 44 45 (defadvice erc-channel-receive-names (before anything-c-erc-nick-inc-@ activate) 46 (anything-c-erc-receive-names (ad-get-arg 0))) 47 48 (defun anything-c-erc-receive-names (names) 49 (ignore-errors 50 (loop for s in (split-string names) 51 when (and (stringp s) 52 (not (string-equal "" s))) 53 do (add-to-list 'anything-c-erc-nicks s)))) 36 54 37 55 ;;; Sources … … 46 64 (persistent-action . switch-to-buffer))) 47 65 66 67 (defvar anything-c-source-erc-nicks 68 '((name . "Erc Nicknames") 69 (init . (lambda () 70 (let ((los (or anything-c-erc-nicks 71 (pcomplete-erc-nicks)))) 72 (with-current-buffer (anything-candidate-buffer 'global) 73 (insert (mapconcat 'identity los "\n")))))) 74 (candidates-in-buffer) 75 (action . (("Insert" . (lambda (name) 76 (insert name erc-pcomplete-nick-postfix))))) 77 (persistent-action . switch-to-buffer))) 78 48 79 (defvar anything-c-erc-sources 49 '(anything-c-source-erc-iswitchb)) 80 '(anything-c-source-erc-iswitchb 81 anything-c-source-erc-nicks)) 50 82 51 83 ;;; Commands … … 54 86 (anything anything-c-erc-sources)) 55 87 88 (defun anything-c-erc-complete-nick () 89 (interactive) 90 (anything '(anything-c-source-erc-nicks))) 91 56 92 (provide 'anything-c-erc) 57 93 ;;; anything-c-erc.el ends here
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)