diff options
| author | Zachary Ferguson <zfergus2@users.noreply.github.com> | 2015-10-07 23:53:53 -0400 | 
|---|---|---|
| committer | Zachary Ferguson <zfergus2@users.noreply.github.com> | 2015-10-07 23:53:53 -0400 | 
| commit | 342488f6a8de5ab91f555a6463f5d9dc85a3079a (patch) | |
| tree | 1afa96957269a218ef2a84d9c9a2d4ab462e8fef /elisp.html.markdown | |
| parent | 4e4072f2528bdbc69cbcee72951e4c3c7644a745 (diff) | |
| parent | abd7444f9e5343f597b561a69297122142881fc8 (diff) | |
Merge remote-tracking branch 'adambard/master' into adambard/master-cn
Diffstat (limited to 'elisp.html.markdown')
| -rw-r--r-- | elisp.html.markdown | 22 | 
1 files changed, 11 insertions, 11 deletions
| diff --git a/elisp.html.markdown b/elisp.html.markdown index d3910759..3bed5d1c 100644 --- a/elisp.html.markdown +++ b/elisp.html.markdown @@ -29,7 +29,7 @@ filename: learn-emacs-lisp.el  ;; I hereby decline any responsability.  Have fun!  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;  +;;  ;; Fire up Emacs.  ;;  ;; Hit the `q' key to dismiss the welcome message. @@ -42,9 +42,9 @@ filename: learn-emacs-lisp.el  ;; The scratch buffer is the default buffer when opening Emacs.  ;; You are never editing files: you are editing buffers that you  ;; can save to a file. -;;  +;;  ;; "Lisp interaction" refers to a set of commands available here. -;;  +;;  ;; Emacs has a built-in set of commands available in every buffer,  ;; and several subsets of commands available when you activate a  ;; specific mode.  Here we use the `lisp-interaction-mode', which @@ -109,7 +109,7 @@ filename: learn-emacs-lisp.el  ;; The empty parentheses in the function's definition means that  ;; it does not accept arguments.  But always using `my-name' is  ;; boring, let's tell the function to accept one argument (here -;; the argument is called "name"):  +;; the argument is called "name"):  (defun hello (name) (insert "Hello " name))  ;; `C-xC-e' => hello @@ -280,10 +280,10 @@ filename: learn-emacs-lisp.el  ;; should stop searching at some point in the buffer, and whether it  ;; should silently fail when nothing is found: -;; (search-forward "Hello" nil t) does the trick: +;; (search-forward "Hello" nil 't) does the trick:  ;; The `nil' argument says: the search is not bound to a position. -;; The `t' argument says: silently fail when nothing is found. +;; The `'t' argument says: silently fail when nothing is found.  ;; We use this sexp in the function below, which doesn't throw an error: @@ -294,7 +294,7 @@ filename: learn-emacs-lisp.el      (mapcar 'hello list-of-names)      (goto-char (point-min))      ;; Replace "Hello" by "Bonjour" -    (while (search-forward "Hello" nil t) +    (while (search-forward "Hello" nil 't)        (replace-match "Bonjour"))      (other-window 1)) @@ -305,7 +305,7 @@ filename: learn-emacs-lisp.el  (defun boldify-names ()      (switch-to-buffer-other-window "*test*")      (goto-char (point-min)) -    (while (re-search-forward "Bonjour \\(.+\\)!" nil t) +    (while (re-search-forward "Bonjour \\(.+\\)!" nil 't)        (add-text-properties (match-beginning 1)                             (match-end 1)                             (list 'face 'bold))) @@ -317,9 +317,9 @@ filename: learn-emacs-lisp.el  ;; The regular expression is "Bonjour \\(.+\\)!" and it reads:  ;; the string "Bonjour ", and -;; a group of           | this is the \\( ... \\) construct -;;   any character      | this is the . -;;   possibly repeated  | this is the + +;; a group of            | this is the \\( ... \\) construct +;;   any character       | this is the . +;;   possibly repeated   | this is the +  ;; and the "!" string.  ;; Ready?  Test it! | 
