Ivan Andrus avatar Ivan Andrus committed 256051d

Initial version

Comments (0)

Files changed (4)

+
+;; TODO: Documentation
+;; TODO: Make it persistent by saving to a file
+;; TODO: Make an `unlocks' attribute so that using org-mode will (require 'org-achievements)
+;; TODO: easy way to show a random unearned achievement, perhaps on an idle timer
+
+(require 'cl)
+
+(defvar achievements-list nil
+  "List of all possible achievements.")
+
+(defvar achievement-score 0
+  "Score of all earned achievements.")
+
+;;{{{ Defining achievements
+
+(defstruct
+    (emacs-achievement
+     (:constructor nil)
+     (:constructor make-achievement
+                   (name description
+                         ;; &optional (predicate t)
+                         &key
+                         ;; slots
+                         points transient min-score predicate
+                         ;; convenience
+                         package variable command
+                         &aux (predicate
+                               `(lambda ()
+                                  ;; package
+                                  (and
+                                   ,@(when package
+                                       (list (list 'featurep
+                                                   (list 'quote package))))
+                                   ,@(when variable
+                                       (list (list 'achievements-variable-was-set
+                                                   (list 'quote variable))))
+                                   ,@(when command
+                                       (list (list 'achievements-command-was-run
+                                                   (list 'quote command))))
+                                   ;; TODO: allow functions here not just forms
+                                   ,@(when predicate
+                                       (list predicate))))))))
+
+  (name nil :read-only t)
+  description
+  (points 5)
+  (predicate nil :read-only t) ;; t if satisfied, nil if opted out, otherwise a function which should return non-nil on success
+  transient ;; if non-nil then results won't be saved, but constantly re-evaluated.
+  (min-score 0)
+  )
+
+(defmacro defachievement (name &rest body)
+  `(add-to-list 'achievements-list
+                ,(if (stringp (car-safe body))
+                     `(make-achievement ,name ,@body)
+                   `(make-achievement ,name nil ,@body)
+                   )
+                t
+                ;; compare function
+                ))
+
+(defmacro defcommand-achievements (format-str body &rest arguments)
+  (cons 'progn
+       (loop for achiev in body
+             collect (append
+                      (list 'defachievement
+                            (cadr achiev)
+                            (format format-str
+                                    (car achiev)
+                                    (cddr achiev))
+                            :command (list 'function (car achiev)))
+                      arguments))))
+
+(defmacro defvalue-achievements (var format-str body &rest arguments)
+  (cons 'progn
+        (loop for achiev in body
+              collect (append
+                       (list 'defachievement
+                             (car achiev)
+                             (format format-str
+                                     (if (car-safe (cddr achiev))
+                                         (car (cddr achiev))
+                                       (cadr achiev))
+                                     var)
+                             :variable (list 'quote
+                                             (list var (cadr achiev))))
+                       arguments))))
+
+;;}}}
+;;{{{ Testing achievements
+
+(defun achievements-variable-was-set (var)
+  "Return non-nil if VAR has been set in customize or .emacs"
+  (if (listp var)
+      (equal (symbol-value (car var)) (cdr var))
+    ;; it was set via customize etc.
+    ))
+
+(defun achievements-num-times-commands-were-run (command-list)
+  (cond ((require 'command-frequency nil t)
+         (let ((command-freq (cdr (command-frequency-list)))
+               (total 0))
+           (loop for com in command-freq
+                 if (member (car com) command-list)
+                 do (setq total (+ total (cdr com))))
+           total))
+        (t nil)))
+
+(defun achievements-command-was-run (command)
+  "Return non-nil if COMMAND has been run.
+It can be a single command form or list of command forms.
+If it's a list of forms, then all must be run.
+Each form has one of the forms
+ COMMAND -- must be run once
+ (CMD1 CMD2 ...) -- any can be run
+ (COMMAND . COUNT) -- must be run COUNT times
+ ((CMD1 CMD2 ...) . COUNT) -- must be run COUNT times
+symbol for a command which must be."
+  (let (command-list)
+    (cond
+     ;; A symbol
+     ((symbolp command)
+      (>= (achievements-num-times-commands-were-run (list command))
+          1))
+     ;; cdr is a number
+     ((numberp (cdr command))
+      (>= (achievements-num-times-commands-were-run
+           (if (listp (car command)) (car command) (list (car command))))
+          (cdr command)))
+
+     ;; A list of commands that are AND-ed
+     ((or (symbolp (car-safe command))
+          (numberp (cdr-safe (car-safe command))))
+      (every 'achievements-command-was-run command))
+     (t
+      (>= (achievements-num-times-commands-were-run
+           (car command))
+          1)))))
+;;}}}
+;;{{{ Display
+
+(defun achievements-update-score ()
+  (setq achievement-score 0)
+  (dolist (achievement achievements-list)
+    (let ((pred (emacs-achievement-predicate achievement)))
+      (when (achievements-earned-p achievement)
+        (setq achievement-score (+ achievement-score
+                                   (emacs-achievement-points achievement)))
+        (unless (emacs-achievement-transient achievement)
+          (setf (emacs-achievement-predicate achievement) t)))))
+  achievement-score)
+
+(defun achievements-earned-p (achievement)
+  "Returns non-nil if the achievement is earned."
+  (let ((pred (emacs-achievement-predicate achievement)))
+    (or (eq pred t)
+        (and (listp pred)
+             (funcall pred)))))
+
+;; TODO: Use `tabulated-list-mode' -- what package.el uses or ewoc
+(defun achievements-list-achievements ()
+  "Display all achievements including whether they have been achieved."
+  (interactive)
+  (pop-to-buffer "*Achievements*")
+  (delete-region (point-min) (point-max))
+  (achievements-update-score)
+  (dolist (achievement achievements-list)
+    (let ((pred (emacs-achievement-predicate achievement)))
+      (when (>= achievement-score
+                (emacs-achievement-min-score achievement))
+          (insert (format "%s %20s | %s\n"
+                      (cond ((eq pred nil) ":-|")
+                            ((eq pred t) ":-)")
+                            ((listp pred)
+                             (if (funcall pred) ":-)" ":-("))
+                            (t ":-?"))
+                      (emacs-achievement-name achievement)
+                      (emacs-achievement-description achievement)))))))
+
+;;}}}
+
+(require 'basic-achievements)
+
+(provide 'achievements)

basic-achievements.el

+;;{{{ meta
+
+(defachievement "Achiever"
+  "You used the achievements package."
+  :predicate t)
+
+(defachievement "Not All There"
+  "You have a fractional achievement score."
+  ;; Note: This is meant to be the only one that has fractional score
+  :points .5)
+
+(defachievement "Unlocker"
+  "You have earned over 50 points in Emacs achievements.  Not bad."
+  :predicate '(> achievement-score 50))
+
+(defachievement "Over Achiever"
+  "You have earned 500 points in Emacs achievements.  Don't you have some real work to do?"
+  :predicate '(> achievement-score 500))
+
+(defachievement "Cheater"
+  "You have earned all Emacs achievements.  Actually that's impossible."
+  :predicate '(every #'achievements-earned-p achievements-list))
+
+;;}}}
+;;{{{ Help
+
+(defachievement "Free Software Zealot"
+  "You've read the sales pitch."
+  :command '(about-emacs
+             describe-copying
+             describe-distribution
+             describe-gnu-project
+             describe-no-warranty))
+
+(defcommand-achievements
+  "You learned new things by using `%s'."
+  ((help-for-help "First things first.")
+   (help-with-tutorial "Show me the way.") ;; Also one if finished the tutorial
+   (info-emacs-manual "RTFM")
+   (view-echo-area-messages "Log Auditor")
+   (view-emacs-FAQ "FAQ")
+   (view-emacs-news "What's new?")
+   (view-emacs-problems "Am I the only one?")
+   (view-emacs-debugging "Entomologist")
+   (view-emacs-todo "Joining the cause")
+   (view-external-packages "Where else can I look?")
+   ((view-hello-file
+     describe-language-environment
+     describe-input-method
+     describe-coding-system) "World Traveler")
+   ((finder-by-keyword describe-package) "Package Hunter")))
+
+(defcommand-achievements
+  "You answered a question by using `%s'."
+  ((apropos-documentation "I know I read it somewhere")
+   (apropos "Apropos of Nothing")
+   (apropos-value "Answer in search of a question")
+   (describe-bindings "What to type?")
+   ((describe-function
+     Info-goto-emacs-command-node
+     info-lookup-symbol
+     describe-variable
+     describe-mode) "What does this do?")
+   ((describe-key
+     describe-key-briefly
+     Info-goto-emacs-key-command-node
+     where-is) "What happens when I do this?")
+   (describe-syntax "When is a word not a word?")
+   ((command-history view-lossage) "What did I just do?")))
+(progn
+  (defachievement
+    (quote apropos-documentation)
+    "You answered a question by using `I know I read it somewhere'." :command
+    (function apropos-documentation))
+  (defachievement
+    (quote apropos)
+    "You answered a question by using `Apropos of Nothing'." :command
+    (function apropos))
+  (defachievement
+    (quote apropos-value)
+    "You answered a question by using `Answer in search of a question'." :command
+    (function apropos-value))
+  (defachievement
+    (quote describe-bindings)
+    "You answered a question by using `What to type?'." :command
+    (function describe-bindings))
+  (defachievement
+    (quote
+     (describe-function Info-goto-emacs-command-node info-lookup-symbol describe-variable describe-mode))
+    "You answered a question by using `What does this do?'." :command
+    (function
+     (describe-function Info-goto-emacs-command-node info-lookup-symbol describe-variable describe-mode)))
+  (defachievement
+    (quote
+     (describe-key describe-key-briefly Info-goto-emacs-key-command-node where-is))
+    "You answered a question by using `What happens when I do this?'." :command
+    (function
+     (describe-key describe-key-briefly Info-goto-emacs-key-command-node where-is)))
+  (defachievement
+    (quote describe-syntax)
+    "You answered a question by using `When is a word not a word?'." :command
+    (function describe-syntax))
+  (defachievement
+    (quote
+     (command-history view-lossage))
+    "You answered a question by using `What did I just do?'." :command
+    (function
+     (command-history view-lossage))))
+
+(defachievement "Shortcut genius"
+  "You don't need to learn new shortcuts anymore."
+  :variable '(suggest-key-bindings nil))
+
+;; (display-local-help "")              ;; What is this?
+;; (defachievement ""
+;;   "You have read at least 10 pages of the read the manual.")
+;; (defachievement "Book worm"
+;;   "You have read at least 100 pages of the read the manual.")
+;; eldoc
+
+;;}}}
+;;{{{ .emacs
+
+(defachievement "Streamlined"
+  "Your .emacs took less that 1 second to load."
+  :predicate '(< (float-time (time-subtract after-init-time before-init-time)) 1)
+  :transient t)
+
+(defachievement "Oops"
+  "Your .emacs file had an error."
+  :predicate 'init-file-had-error)
+
+(defachievement "Traditionalist"
+  "You use .emacs instead of .emacs.d/init.el."
+  :predicate '(string-match "/\\.emacs\\'" user-init-file))
+
+(defachievement "Modernist"
+  "You use .emacs.d/init.el instead of .emacs."
+  :predicate '(string-match "/init\\.el\\'" user-init-file))
+
+(defachievement "Post Modernist"
+  "You don't use .emacs.d/init.el or .emacs."
+  :predicate '(not (or (string-match "/init\\.el\\'" user-init-file)
+                       (string-match "/\\.emacs\\'" user-init-file))))
+
+(defachievement "Need for Speed"
+  "Your .emacs is byte-compiled."
+  :predicate '(or (file-exists-p (concat user-init-file "c"))
+                  ;; TODO: I _think_ this is right for .emacs
+                  (file-exists-p (concat user-init-file ".elc"))))
+
+(defachievement "Byte-compiled out of date"
+  "Your .emacs is byte-compiled."
+  :predicate '(cond ((file-exists-p (concat user-init-file "c"))
+                     (file-newer-than-file-p
+                      user-init-file
+                      (concat user-init-file "c")))
+                    ((file-exists-p (concat user-init-file ".elc"))
+                     (file-newer-than-file-p
+                      user-init-file
+                      (concat user-init-file ".elc")))))
+
+(defachievement "Purest Vanilla"
+  "You have no .emacs file.  How is that even possible?"
+  :predicate '(not (file-exists-p user-init-file)))
+
+;; Other sizes here
+;; (defachievement "Jabba the Hutt"
+;;   "Your .emacs is so big, it runs a crime syndicate on Tatooine."
+;;   )
+
+;;}}}
+;;{{{ Fun and Games
+
+(defcommand-achievements
+  "You have enjoyed `%s'."
+  ((5x5 "Twenty Five")
+   (animate "The Future of Pixar")
+   (artist-mode "Van Gogh")
+   (blackbox "Hide and Seek")
+   (bubbles "Blubb blubb")
+   (butterfly "Change the world!")
+   (decipher "Spy vs Spy")
+   (dissociated-press "Tabloids")
+   (doctor "I <3 Eliza")
+   (dunnet "Adventure!")
+   (gomoku "Connect 5")
+   (handwrite "Penmanship")
+   (hanoi "Saigon")
+   ;; (landmark "") ;; I have no idea what this is
+   (life "It's Alive!")
+   (morse-region "Telegraph Operator")
+   (mpuz "Arithmetician")
+   (pong "Ping")
+   (snake "Chase your tail")
+   (solitaire "All alone?")
+   (tetris "Tessellator")
+   (yow "Yow!")
+   (zone "The Matrix"))
+  :min-score 50)
+
+;; These probably need packages.  Also check out
+;; http://www.emacswiki.org/emacs/CategoryGames
+(defcommand-achievements
+  "You have installed and enjoyed `%s'."
+  ((emstar "Um, Star?" )
+   (fliptext-flip-region "Can you read upside down?")
+   (nethack "Hack, hack, hack.")
+   (nyan-mode "Nyan, Nyan, Nyan"))
+  :min-score 100)
+
+;;}}}
+;;{{{ uptimes
+
+(defachievement "Pretty Stable"
+  "You have an uptime of over 1 day."
+  :package 'uptimes
+  :predicate `(> (let* ((uptime (car uptimes-top-n))
+                        (seconds (- (cddr uptime) (cadr uptime))))
+                   seconds)
+                 ,(* 60 60 24 1)))
+
+(defachievement "It keeps going and going..."
+  "You have an uptime of over 1 week."
+  :package 'uptimes
+  :predicate `(> (let* ((uptime (car uptimes-top-n))
+                        (seconds (- (cddr uptime) (cadr uptime))))
+                   seconds)
+                 ,(* 60 60 24 7)))
+
+(defachievement "Marathon Hacker"
+  "You have an uptime of over 30 days."
+  :package 'uptimes
+  :predicate `(> (let* ((uptime (car uptimes-top-n))
+                        (seconds (- (cddr uptime) (cadr uptime))))
+                   seconds)
+                 ,(* 60 60 24 30)))
+
+(defachievement "Methuselah"
+  "You have an uptime of over 1 year!?"
+  :package 'uptimes
+  :predicate `(> (let* ((uptime (car uptimes-top-n))
+                        (seconds (- (cddr uptime) (cadr uptime))))
+                   seconds)
+                 ,(* 60 60 24 365)))
+
+;;}}}
+;;{{{ Number of characters written
+
+(defachievement "Short Story"
+  "You've written the equivalent of a short story."
+  :predicate `(> (achievements-num-times-commands-were-run
+                 '(self-insert-command
+                   org-self-insert-command))
+                 ,(* 2000 6)))        ;; ~ 5/word + space
+
+(defachievement "Nanowrimo"
+  "You could have finished Nanowrimo by now."
+  :predicate `(> (achievements-num-times-commands-were-run
+                 '(self-insert-command
+                   org-self-insert-command))
+                 ,(* 50000 6)))
+
+(defachievement "War and Peace"
+  "You've written the equivalent of War and Peace."
+  :predicate `(> (achievements-num-times-commands-were-run
+                 '(self-insert-command
+                   org-self-insert-command))
+                 ,(* 587287 6)))
+
+(defachievement "Proust"
+  "You could have beaten Proust for longest novel."
+  :predicate `(> (achievements-num-times-commands-were-run
+                 '(self-insert-command
+                   org-self-insert-command))
+                 ,(* 1200000 6)))
+
+;;}}}
+;;{{{ Operating system
+
+(defachievement "Loyalist"
+  "You use GNU Emacs"
+  :predicate '(not (string-match "XEmacs\\|Lucid" emacs-version)))
+
+(defachievement "Patriot or Rebel?"
+  "You use XEmacs"
+  :predicate '(string-match "XEmacs\\|Lucid" emacs-version))
+
+;; (defachievement "Switch Hitter"
+;;   "You use both GNU Emacs and XEmacs")
+
+;; What version of emacs you are using
+
+(defvalue-achievements window-system
+  "You have used the %s version Emacs."
+  (("Green Glowing faces" nil "console")
+   ("X marks the spot" x)
+   ("MacPort or Aquamacs" mac)
+   ("GNUStep or Cocoa" ns "nextstep")
+   ("Windows" w32 "windows")
+   ("DOS?" pc "DOS")))
+
+(defvalue-achievements system-type
+  "You have used Emacs on a %s system."
+  (("Following the Hurd" gnu)
+   ("Tux's Friend" gnu/linux)
+   ("Beastie's Pal" gnu/kfreebsd)
+   ("Friends with Hexley" darwin)
+   ("DOS Box" ms-dos)
+   ("Windows Machine" windows-nt)
+   ("The Swan" cygwin)))
+
+;;}}}
+;;{{{ Identity
+
+(defachievement "Anonymous"
+  "You have `user-mail-address' set to nil."
+  :predicate '(equal user-mail-address nil))
+
+(defachievement "The One and Only"
+  "You are Richard Stallman."
+  :predicate '(equal user-mail-address "rms@gnu.org")
+  :points 50)
+
+;; TODO: need list of old maintainers, as well as for XEmacs
+(defachievement "A Well Oiled Machine"
+  "You help maintain Emacs."
+  :predicate '(member user-mail-address
+                      '("rms@gnu.org"
+                        "cyd@gnu.org"
+                        "monnier@iro.umontreal.ca"))
+  :points 50)
+
+;;}}}
+;;{{{ packages
+
+(defachievement "Tainted Love"
+  "You have enabled non-GNU package repositories."
+  :package 'package
+  :predicate '(some (lambda (repo)
+                      (not (string-match "elpa\\.gnu\\.org" (cdr repo))))
+                    package-archives))
+
+(defachievement "Vanilla"
+  "You have no installed packages."
+  :predicate '(= (length package-alist) 0))
+
+(defachievement "Package Neophyte"
+  "You have installed at least 1 package."
+  :predicate '(>= (length package-alist) 1))
+
+(defachievement "Package Apprentice"
+  "You have installed over 10 packages."
+  :predicate '(>= (length package-alist) 10))
+
+(defachievement "Package Journeyman"
+  "You have installed over 100 packages."
+  :predicate '(>= (length package-alist) 100))
+
+;; (defachievement "Drew Adams fanboy"
+;;   "You are using 3 or more packages by Drew Adams.")
+
+;; More package creators ...
+
+;;}}}
+;;{{{ Buffers & processess
+
+(defachievement "Clean Desk"
+  "You have less than 10 buffers open."
+  :predicate '(<= (length (buffer-list)) 10))
+
+(defachievement "Messy Desk"
+  "You have over 100 buffers open."
+  :predicate '(>= (length (buffer-list)) 100))
+
+(defachievement "Papers to the ceiling"
+  "You have over 1000 buffers open."
+  :predicate '(>= (length (buffer-list)) 1000))
+
+(defachievement "The Ol' Switcheroo"
+  "You've switched to another buffer"
+  :command '(switch-to-buffer ido-switch-buffer))
+
+(defachievement "Buffer, buffers, everywhere"
+  "You've seen all the buffers that can be seen."
+  :command '(list-buffers ibuffer))
+
+(defachievement "Top o' the morning"
+  "You've used Emacs as a replacement for top."
+  :command 'proced)
+
+;;}}}
+
+(provide 'basic-achievements)

ideas-achievements.el

+
+This is a file with a bunch of random pieces of ideas for
+achievements, and/or improvements to the mechanism.  It is a real
+mess, but hey, it keeps me from forgetting things.
+
+;; http://www.reddit.com/r/emacs/comments/ook6a/does_something_like_this_exist_for_emacs/
+
+;; use view-external-packages as a list of useful packages
+
+
+
+;;{{{ keybindings
+
+(defachievement "The Examined Life"
+  "You have command logging enabled."
+  :package 'command-frequency)
+
+(defachievement "Evil Genius"
+  "Use `evil-mode'.")
+
+(defachievement ""
+  "Use `wordstar-mode'.")
+crisp-mode
+
+(defachievement "Vi Convert"
+  "Use `evil-mode', `viper-mode' or `'."
+  viper vi vip
+  )
+
+(defachievement "Emacs Purist"
+  "You've never used `evil-mode', `viper-mode' or `'.")
+
+[remap ffap-read-only-other-frame]
+keyolution.el
+
+;;}}}
+;;{{{ org
+
+(defachievement "Organizer"
+  "Use `org-mode'.")
+
+(defachievement "Busy Bee"
+  "You have more than 100 TODO items in your agenda")
+
+(defachievement ""
+  "You have used org tables")
+
+(defachievement ""
+  "You have inline code in org-files")
+
+(defachievement ""
+  "You have exported an org file.")
+
+org-replace-region-by-latex
+
+;;}}}
+;;{{{ Lisp
+
+(defachievement ""
+  "You have submitted a bug report.")
+
+(defachievement "Autoload Master"
+  "")
+
+(defachievement ""
+  "You have use M-:")
+
+(defachievement ""
+  "You have use C-x C-e")
+
+(defachievement ""
+  "You have use C-x e")
+elint
+checkdoc
+edebug
+profile
+format-spec
+cl package
+command-switch-alist
+define-derived-mode
+benchmark-run
+hack-let
+debug-on-entry
+debug-on-error
+debug-on-quit
+eval-last-sexp twice to get hex numbers
+ert
+disass
+
+;;}}}
+;;{{{ Modes
+
+(defachievement "Polyglot"
+  "You have used over 50 major-modes.")
+
+(defachievement ""
+  ;; descriptions like this could be autogenerated
+  "You use cperl-mode."
+  :function cperl-mode)
+sh-script-mode
+
+(defachievement ""
+  "You use nxml-mode.")
+
+(defachievement ""
+  "You use ido-mode.")
+
+(defachievement ""
+  "You use ibuffer.")
+
+(defachievement ""
+  "You use AUCTeX.")
+
+(defachievement ""
+  "You use Emacs for IM, IRC, or chat.")
+
+(defachievement ""
+  "You use Emacs for reading email or news.")
+
+(defachievement ""
+  "You use Emacs for surfing the web")
+
+(defachievement ""
+  "You like line numbers")
+
+(defachievement ""
+  "You have compiled C, C++, .")
+
+(defachievement ""
+  "You have used calc")
+
+(defachievement ""
+  "You use midnight mode.")
+
+(defachievement ""
+  "You use rectangles.")
+
+view-mode
+
+;; programming
+which-func-mode
+
+;;}}}
+;;{{{ Variables
+
+(defachievement ""
+  ;; descriptions like this could be autogenerated
+  "You have set `completion-ignored-extensions'."
+  :variable completion-ignored-extensions)
+
+(defachievement ""
+  "You have changed mode-line-format")
+
+(defachievement ""
+  "You have set variables with customize.")
+
+(defachievement ""
+  "You have at least one custom theme.")
+
+(defachievement ""
+  "You have at least 10 custom themes.")
+
+(defachievement "Bilingual"
+  "You have at least 10 custom themes.")
+
+(defachievement ""
+  "Sentences end with 2 spaces.")
+
+(defachievement ""
+  "Sentences end with 1 space.")
+
+(defachievement ""
+  "You have customized faces.")
+
+(defachievement ""
+  "Turn off menus and scroll bars.")
+
+"Keeping up with the Joneses" customize-changed
+
+;;}}}
+;;{{{ Version control
+
+(defachievement "Playing it Safe"
+  "Your .emacs is under version control.")
+
+(defachievement "Old Timer"
+  "Your .emacs has been under version control for over 5 years ago.")
+
+(defachievement ""
+  "You have used smerge-mode to resolve conflicts.")
+
+;;}}}
+;;{{{ Forbidden fruits -- disabled functions
+
+;; (put 'narrow-to-region 'disabled nil)
+
+(defachievement ""
+  "You have used recursive editing.")
+
+(defachievement "Narrow minded"
+  "You have used narrowing.")
+
+;; Find all disabled commands
+
+(loop for s being the symbols
+      when (get s 'disabled) collect s)
+
+;;}}}
+;;{{{ Editing
+
+;; unicode characters
+;; used mark commands
+;; use keyboard macros -- C-x C-k for all things related
+;; name-last-kbd-macro
+;; apply-macro-to-region-lines
+;; use lisp in regular expression replacements
+;; abbrev mode
+;; use registers
+;; scroll other window
+;; follow mode
+;; selective-dsplay C-u C-x $
+;; file-sets
+;; comment-dwim
+;; comment-or-uncomment-region or comment-region
+mark-defun
+mark-whole-buffer
+delete-indentation
+visual-line-mode
+flyspell speck wcheck-mode
+clone-indirect-buffer
+move-to-window-line
+append-next-kill
+scroll-all-mode
+transpose commands -- and with a prefix arg of 0
+(how-to "C-0 M-k -- kill to beginning of line")
+align
+align-regexp
+fill-paragraph
+two-column
+C-q -- especially in search and replace
+
+;;}}}
+;;{{{ Searching and replacing
+
+occur-edit-mode
+ack-and-a-half
+multi-occur
+isearch-edit-string
+(how-to "In incremental search mode:
+Type M-c to toggle search case-sensitivity.
+Type M-r to toggle regular-expression mode.
+Type M-s w to toggle word mode.
+Type M-e to edit the search string in the minibuffer.
+Type M-s h r to highlight the search throughout the buffer")
+find-grep-dired
+wgrep
+C-j -- to match a newline when searching
+
+;;}}}
+;;{{{ whitespace
+
+(defachievement ""
+  "You prefer spaces.")
+
+(defachievement ""
+  "You prefer tabs.")
+
+(defachievement ""
+  "You prefer mixing spaces and tabs.  What's wrong with you?")
+
+(defachievement ""
+  "You hate trailing whitespace.")      ;Call delete-trailing-whitespace 100 times
+
+(defachievement "Unyielding"
+  :command 'indent-rigidly)
+
+whitespace-mode
+
+;;}}}
+;;{{{ misc.
+
+(defachievement "Author")
+(defachievement "Editor"
+  (over 50% are self-insert))
+
+array
+autorevert
+avoid
+battery
+bug-reference
+compare-windows
+diary-lib
+describe-text-properties
+describe-char
+delsel
+dbus
+css-mode
+cwarn
+cua-mode
+subword
+speedbar
+cedet
+sql
+imenu
+ediff
+ecb
+doc-view
+yasnippet/skeleton/etc.
+
+type-break-mode
+enriched-mode
+command-history
+view-lossage
+elint
+flymake
+proced
+re-builder
+count-lines-region
+sort-lines
+sort-columns
+autocomplete
+secrets
+saveplace
+desktop
+rot13
+repeat
+remember
+regex-opt
+
+rcompile
+
+line-spacing
+normal-mode
+;; python-wars locate-library
+repeat-complex-command
+bookmarks
+file/directory local variables
+
+;; Look for "favorite emacs features" articles
+
+network-interface-info
+
+(defachievement "A little help from my friends"
+  "You are using the Emacs starter kit")
+
+(defachievement ""
+  "You use dired.")                     ;and wdired
+
+locate
+
+
+c-eldoc
+ace-jump-mode
+writegood-mode
+writeroom-mode
+drag-stuff
+parenface
+paredit
+num3-mode
+multiple-cursors
+mark-multiple
+keyfreq
+hl-sexp
+highlight-symbol
+
+linum
+
+undo-tree
+emacs-lock
+smex
+emerge
+follow
+finder
+ffap
+face-remap
+fortune
+hexl-mode
+gud
+zencoding-mode.el
+
+
+(defachievement "UTF-8 utf-8 UTF8 utf8")
+(master  "")
+(longlines  "")
+
+backup-directory-alist
+uniquify
+transient-mark-mode
+(line-number-mode 1)
+(column-number-mode 1)
+
+tramp
+tar zip etc.
+
+(defachievement ""
+  "You are running an emacs server.")
+
+
+;; http://stackoverflow.com/questions/154097/whats-in-your-emacs
+
+
+;; Check that the file hasn't been tampered with by using a checksum
+;; (which of course can be changed if they know how).
+
+;; Editing video
+;; Emacsspeak
+;; Using gnus or other mail reader
+;; Ability to opt out of one, e.g. I'll never use viper-mode
+
+;; How about polyglot for using many different major-modes. And an
+;; achievement for having a big .emacs. Or rather an achievement for
+;; every power of ten lines: 10, 100, 1000, 10000, etc. Using M-x
+;; butterfly, the psychologist, all the games, redifing too many
+;; keys... Using sexp keys a lot, having a long uptime, using vc-mode,
+;; having lots of custom-themes... The possibilities are endless. Heck
+;; there could even be one for modifying the source of the
+;; achievements.el.
+
+;; I just got the Mentally Unstable Emacs Badge for using M-x doctor
+;; 113 times in a week!!!! I'm SO proud!
+
+
+;; a function in post-command-hook (or just look at keyboard event, I
+;; think that is possible somehow) that looks for commands/combos the
+;; user uses, could trigger achievements for using stuff like M-x,
+;; eval-expression, prefix args or certain patterns like switching
+;; buffers often without editing, trying to save twice
+
+;; in kill-emacs-hook could for triggering achievements at the end of
+;; the session, for example the time the user spent in emacs, how many
+;; loc he produced throughout the session, how many different files he
+;; edited
+
+;; compilation-finish-function could be used to trigger achievements
+;; like compiling something without errors on the first try, maybe
+;; achievements for certain kinds of simple errors (something like no
+;; main method or a segfault when running, easy to detect stuff)
+
+;; after-buffer-change and before-buffer-change could be used to keep
+;; track of editing to trigger achievements when the user indents
+;; regions, starts using comment-or-uncomment-line on regions, writing
+;; out lots of loc without saving
+
+;; after-save-hook for achievements like the number of concurrent
+;; buffers a user has open, how many modified, using indirect buffers
+
+;; change-major-mode to trigger achievements when the user starts
+;; using certain major-modes, maybe check existence of symbols to
+;; check if the user uses stuff that is not part of emacs like other
+;; modes for programming languages (js2-mode for example), org-mode
+;; (which is now part of emacs I believe), etc
+
+;; I am pretty sure there is more one could come up with. You might be
+;; tempted to use defadvice instead of all those hooks, but I would
+;; strongly suggest not to, defadvice is made of pure evil and I would
+;; try to stay away from it as far as possible.
+
+;; I gave a few brief examples of what I think could be triggers for
+;; achievements but that is not enough when designing
+;; achievements. The final achievements should be helpful and
+;; encouraging in the beginning for new users and later interesting
+;; for advanced users.
+
+;; To give a short example what I mean: an early achievement could be
+;; just switching between buffers, that could encourage someone new to
+;; start using more buffers, and help him learn about managing
+;; them. Later an advanced user using lots of buffers using ibuffer
+;; but without an ibuffer-saved-filter-groups variable would probably
+;; find an achievement interesting that taught him about ibuffers
+;; grouping feature.
+
+;; I think achievements should be seen and designed as part of emacs
+;; help system, for them to make sense they should be some kind of
+;; naturally developing guide through emacs and therefore strongly
+;; rely on the already existing help system.
+
+;; Also there needs to be a way to make them visible to the user when
+;; he gets them in form of notifications (maybe use libnotify?), and
+;; also important, the user has to see 'what is going to come up
+;; next'. He needs that so he can choose what the next achievement is
+;; going to be that he wants to achieve, therefore giving feedback to
+;; the help system what he wants to learn.
+
+;; AUCTeX, a suite of extensions that facilitate the creation of TeX and LaTeX documents
+;; Calc, a powerful RPN numerical calculator
+;; Calendar-mode, for keeping appointment calendars and diaries
+;; Dissociated Press, a Racter-like text generator.
+;; Dunnet, a text adventure
+;; Ediff and Emerge, for comparing and combining files interactively.
+;; Emacs/W3, a web browser
+;; ERC and rcirc, IRC clients (22.1)[30]
+;; Gnus, a full-featured newsreader and email client (and early evidence for Zawinski's Law, along with Rmail)
+;; MULE, MultiLingual extensions to Emacs, allowing editing text written in multiple languages, somewhat analogous to Unicode
+;; Org-mode for keeping notes, maintaining lists (to-do lists and other types of lists) and doing project planning and measuring
+;; Info, an online help-browser
+;; Planner, a personal information manager
+;; SES, a spreadsheet
+;; VM (View Mail), another full-featured email client
+;; Wanderlust, a versatile email and news client
+
+;;}}}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.