From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mitch Fincher Newsgroups: gmane.emacs.tangents Subject: Re: 2016-04-18 Emacs News Date: Mon, 25 Apr 2016 13:08:50 -0500 Message-ID: References: <87wpnvymvt.fsf@sachachua.com> <29224df4-fa4c-48d7-b5f5-9b366bbd8bdc@default> <87potmzwud.fsf@sachachua.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1142833a9b0c0a0531531156 X-Trace: ger.gmane.org 1461616816 28933 80.91.229.3 (25 Apr 2016 20:40:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2016 20:40:16 +0000 (UTC) Cc: emacs-tangents@gnu.org, Drew Adams To: Sacha Chua Original-X-From: emacs-tangents-bounces+get-emacs-tangents=m.gmane.org@gnu.org Mon Apr 25 22:39:54 2016 Return-path: Envelope-to: get-emacs-tangents@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aunIP-0006YX-Ac for get-emacs-tangents@m.gmane.org; Mon, 25 Apr 2016 22:39:53 +0200 Original-Received: from localhost ([::1]:34120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aunIO-0000Cq-II for get-emacs-tangents@m.gmane.org; Mon, 25 Apr 2016 16:39:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aukwI-0004fX-TU for emacs-tangents@gnu.org; Mon, 25 Apr 2016 14:08:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aukwH-0002cV-2x for emacs-tangents@gnu.org; Mon, 25 Apr 2016 14:08:54 -0400 Original-Received: from mail-yw0-x234.google.com ([2607:f8b0:4002:c05::234]:34639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aukwG-0002aW-Iq for emacs-tangents@gnu.org; Mon, 25 Apr 2016 14:08:53 -0400 Original-Received: by mail-yw0-x234.google.com with SMTP id j74so200312837ywg.1 for ; Mon, 25 Apr 2016 11:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=5jk6VoOqunAE0YP3F4kk7Numu49hA7CTf5cPyEv5n6k=; b=Expvk1FsRHnF32Vk2Ykt4acDNF5ee0U12NBeidyicmD4Mag7dteQOYLocgd7R0sYfm V/jCO1lwTUTPNsA6fntVXns+S2guOB5Ir0JyGvN+rN+vF/n/+FRuo1LKQE4acMVU2kzr /u28zv9eaU955Pb8lVX6NM5Np288oRCofJsLIarTLet6hHyUA7RpU4qnD4M/pwdpqfI6 GVNuEElXhUW5QsFjscnbZvXJZzxnRBwJF1C41kB67P0/b6ydUYQ6kfYt2I2RrEZt7LF7 2Uh6AnFLX4AGGg+CkUDdiBTy1pIrBE88kewCJr5aeLXAMOMzmgsVU3ap5VJm9nbcekEq I6sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5jk6VoOqunAE0YP3F4kk7Numu49hA7CTf5cPyEv5n6k=; b=A8wjiXRtTIzz4RxD8GiTiqFVtA4dq6WwTkqFZUOT34ZLs2B6pbdZWyWoznOrKTyIDa WaxJyv48x5Hsn/3Q5rFWxANzhjphutnQxZmqf4eWXusy3dgO5RtKrWA+Sj9kIt+5NZOD SnXkDwFJ07QgxNr4QJu1Ru4JDkH6h81blapeu86bXwMvisPShse4OTwIQu/xUkT22Ohp a9YSfP3NN7IAv1vbbbaXgBez6Wg3tfrfgdHFvPQ8RrU7kN8n0r5eSb5P51vU2gEq0GYJ va+w0dKvs9bq7t9N1kHiq9bYw00dOMzCexVLTvro1R2hpusH9HzbqPqY7WgQWYlOVGBy bn/w== X-Gm-Message-State: AOPr4FWXXyC3REpawQtOewoiWfbvBIAKIIhU9Oouidbv66vKDyiui/nNk2P/aoxc/eXzWwNayXzt5/GoxTtvMQ== X-Received: by 10.129.36.7 with SMTP id k7mr21504369ywk.186.1461607730966; Mon, 25 Apr 2016 11:08:50 -0700 (PDT) Original-Received: by 10.37.203.12 with HTTP; Mon, 25 Apr 2016 11:08:50 -0700 (PDT) In-Reply-To: <87potmzwud.fsf@sachachua.com> X-Google-Sender-Auth: 51uGYo9r-GfxLzy-0dfU0A_r7W4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::234 X-Mailman-Approved-At: Mon, 25 Apr 2016 16:39:46 -0400 X-BeenThere: emacs-tangents@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-tangents-bounces+get-emacs-tangents=m.gmane.org@gnu.org Original-Sender: "Emacs-tangents" Xref: news.gmane.org gmane.emacs.tangents:122 Archived-At: --001a1142833a9b0c0a0531531156 Content-Type: text/plain; charset=UTF-8 Hi All, Thanks so much for your comments! It's wonderful to have such good, detailed feedback. I appreciate this more than you know. I wrote this page a long time ago when learning Emacs lisp, so it's no surprise it may be a little out of date. I will carefully evaluate your comments and update the page soon - I'm in the middle of a job search now, so it may be a little bit. Thanks again! Sincerely, Mitch Fincher On Mon, Apr 18, 2016 at 11:48 AM, Sacha Chua wrote: > Drew Adams writes: > > >> A nice and clear summary of Emacs Lisp (Reddit) > >> http://www.fincher.org/tips/Languages/Emacs.shtml > > Hm. It's generally good to see such summaries. But > > this one is not as nice and clear as it might be, IMO. > > It is also somewhat out of date. > > Thanks for the detailed feedback, Drew! I'm looping in the author here > so that the tutorial can be updated - see Drew's notes below. > > https://www.reddit.com/r/emacs/comments/4f7q0f/a_nice_and_clear_summary_of_emacs_lisp/ > also has more comments. > > > (set 'fname "Mitch") > > > > Not a great example of what `set' is used for. If this > > were a common use case then we would need only `setq'. > > > > (setq fname "Mitch") > > > > Doesn't bring much attention to the fact that the second > > arg is evaluated and its value is used. IOW, something > > like a string, which is self-quoting, is not the best > > thing to show in such an example. > > > > (list 'a 'x "asdf" 6) => (list a x "asdf" 6) > > > > Should be => (a x "asdf" 6) - no "list". But even that > > would not bring much attention to the fact that each arg > > is evaluated. > > > > (sort '(5 3 9 27) '<) => (3 5 9 27) > > > > Well yes, but, especially if introducing this to newbies, > > the destructive nature of `sort' is really important to > > point out. > > > > (concat "I " "went to " "the woods ")=> "I went to the woods " > > > > Might be good to use some arguments that are characters > > and lists of chars - especially characters. > > > > (length "I went to the woods ")=> 20 > > > > Yes, but `string-width' is typically more appropriate for > > strings (and there is `string-bytes'). A more typical > > `length' use case would be with a list or a vector. > > > > (aref s i) > > returns the ith char (0 based) > > (aref "abcd" 2)=> 99 > > > > It's not about counting characters. `aref' is for any > > array, not just a string. Same for `aset' description. > > > > Section "Logical functions (and, or, not, eq)" does not > > say what constitutes a "true" or a "false" value. In > > particular, it does not say that non-nil is treated as > > true by most predicates (including `and', `or', and `not'). > > > > "equal takes two args and tests if the values are equal" > > > > Doesn't say what it means for two values to be "equal". > > > > Section "Function Template" is really a command-definition > > template. > > > > "Commands and functions can also have hooks. These are > > created using 'defadvice'." > > > > Kind of. But they are not called "hooks" in Emacs (e.g. > > in the doc). And `defadvice' is now deprecated, in favor > > of the new advice system. > > > > `let': "uninitialized variables may also be used... This > > creates temporary variables "c" and "d", but assigns no > > value." > > > > That is wrong - vars `c' and `d' are bound to nil. > > > > "let* ;; forces sequential execution" > > > > No, sequential (i.e., dependent) bindings. Execution of > > the body of `let' is also sequential. > > > > "if the documentation string begins with a "*", the variable > > is user definable with the M-xset-variable command" > > > > No. This behavior was (unfortunately, IMO) removed long ago. > > > > Introducing `reduce', regexps, and macros is too advanced, > > and too unexplained, for this high-level intro. It can > > erroneously give the impression of authority or expertise. > > > > It might be different if (a) these things were actually > > described/explained here and (b) there was not so much > > that is wrong or misleading in the basic stuff presented. > > > > "defunst - defunst works like defun but "inlines" the function. > > Works like "Inline" in C++." > > > > No. `defunst' does not exist in Emacs Lisp. `defsubst' > > was presumably meant. > > > > `interactive': "r - the hilighted region" > > > > No; it is the region, active (highlighted) or not. > > > > `C-h a' is not `command-apropos' but `apropos-command'. > > > > `C-h C-k' is not `Info-goto-emacs-key-command-node'. > > > > `E-!' should be `M-!' (or `ESC !'). > > > > The link to the W3 web browser is broken. And `eww' might > > be a better choice now (?). > > > > The commands bound to `C-x (', `C-x )', and `C-x e' have been > > different for years now (kmacro was introduced in Emacs 22!). > > > > In sum, again, it's good that people post such summaries, but > > they can also be harmful/misleading. If they are posted to > > a community place such as Emacs Wiki then they at least have > > a better chance of getting corrected and updated. > > > > And I really recommend _asking Emacs_ itself, including the > > manuals. There is a good intro manual to learning Emacs Lisp > > that comes with Emacs. > -- Gravity never sleeps.. --001a1142833a9b0c0a0531531156 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi All,

Thanks so much for your com= ments!=C2=A0 It's wonderful to have such good, detailed feedback.
I appreciate this more than you know.
I wrote this p= age a long time ago when learning Emacs lisp, so it's no surprise it ma= y be a little out of date.
I will carefully evaluate your com= ments and update the page soon - I'm in the middle of a job search now,= so it may be a little bit.

Thanks again!
S= incerely,
Mitch Fincher

On Mon, Apr 18, 2016 at 11:48 AM, Sacha= Chua <sacha@sachachua.com> wrote:
Drew Adams <drew.= adams@oracle.com> writes:

>> A nice and clear summary of Emacs Lisp (Reddit)
>> http://www.fincher.org/tips/Languages/Ema= cs.shtml
> Hm.=C2=A0 It's generally good to see such summaries.=C2=A0 But
> this one is not as nice and clear as it might be, IMO.
> It is also somewhat out of date.

Thanks for the detailed feedback, Drew! I'm looping in the author here<= br> so that the tutorial can be updated - see Drew's notes below.
https://www.re= ddit.com/r/emacs/comments/4f7q0f/a_nice_and_clear_summary_of_emacs_lisp/
also has more comments.

>=C2=A0 (set 'fname "Mitch")
>
> Not a great example of what `set' is used for.=C2=A0 If this
> were a common use case then we would need only `setq'.
>
>=C2=A0 (setq fname "Mitch")
>
> Doesn't bring much attention to the fact that the second
> arg is evaluated and its value is used.=C2=A0 IOW, something
> like a string, which is self-quoting, is not the best
> thing to show in such an example.
>
>=C2=A0 (list 'a 'x "asdf" 6) =3D> (list a x "= asdf" 6)
>
> Should be =3D> (a x "asdf" 6) - no "list".=C2= =A0 But even that
> would not bring much attention to the fact that each arg
> is evaluated.
>
>=C2=A0 (sort '(5 3 9 27) '<) =3D> (3 5 9 27)
>
> Well yes, but, especially if introducing this to newbies,
> the destructive nature of `sort' is really important to
> point out.
>
>=C2=A0 (concat "I " "went to " "the woods &quo= t;)=3D> "I went to the woods "
>
> Might be good to use some arguments that are characters
> and lists of chars - especially characters.
>
>=C2=A0 (length "I went to the woods ")=3D> 20
>
> Yes, but `string-width' is typically more appropriate for
> strings (and there is `string-bytes').=C2=A0 A more typical
> `length' use case would be with a list or a vector.
>
>=C2=A0 (aref s i)
>=C2=A0 returns the ith char (0 based)
>=C2=A0 (aref "abcd" 2)=3D> 99
>
> It's not about counting characters.=C2=A0 `aref' is for any > array, not just a string.=C2=A0 Same for `aset' description.
>
> Section "Logical functions (and, or, not, eq)" does not
> say what constitutes a "true" or a "false" value.= =C2=A0 In
> particular, it does not say that non-nil is treated as
> true by most predicates (including `and', `or', and `not')= .
>
>=C2=A0 "equal takes two args and tests if the values are equal&quo= t;
>
> Doesn't say what it means for two values to be "equal".<= br> >
> Section "Function Template" is really a command-definition > template.
>
>=C2=A0 "Commands and functions can also have hooks. These are
>=C2=A0 =C2=A0created using 'defadvice'."
>
> Kind of.=C2=A0 But they are not called "hooks" in Emacs (e.g= .
> in the doc).=C2=A0 And `defadvice' is now deprecated, in favor
> of the new advice system.
>
>=C2=A0 =C2=A0`let': "uninitialized variables may also be used.= ..=C2=A0 This
>=C2=A0 =C2=A0 creates temporary variables "c" and "d&quo= t;, but assigns no
>=C2=A0 =C2=A0 value."
>
> That is wrong - vars `c' and `d' are bound to nil.
>
>=C2=A0 =C2=A0"let* ;; forces sequential execution"
>
> No, sequential (i.e., dependent) bindings.=C2=A0 Execution of
> the body of `let' is also sequential.
>
>=C2=A0 "if the documentation string begins with a "*", t= he variable
>=C2=A0 =C2=A0is user definable with the M-xset-variable command" >
> No.=C2=A0 This behavior was (unfortunately, IMO) removed long ago.
>
> Introducing `reduce', regexps, and macros is too advanced,
> and too unexplained, for this high-level intro.=C2=A0 It can
> erroneously give the impression of authority or expertise.
>
> It might be different if (a) these things were actually
> described/explained here and (b) there was not so much
> that is wrong or misleading in the basic stuff presented.
>
>=C2=A0 "defunst - defunst works like defun but "inlines"= the function.
>=C2=A0 =C2=A0Works like "Inline" in C++."
>
> No.=C2=A0 `defunst' does not exist in Emacs Lisp.=C2=A0 `defsubst&= #39;
> was presumably meant.
>
>=C2=A0 `interactive': "r - the hilighted region"
>
> No; it is the region, active (highlighted) or not.
>
> `C-h a' is not `command-apropos' but `apropos-command'. >
> `C-h C-k' is not `Info-goto-emacs-key-command-node'.
>
> `E-!' should be `M-!' (or `ESC !').
>
> The link to the W3 web browser is broken.=C2=A0 And `eww' might > be a better choice now (?).
>
> The commands bound to `C-x (', `C-x )', and `C-x e' have b= een
> different for years now (kmacro was introduced in Emacs 22!).
>
> In sum, again, it's good that people post such summaries, but
> they can also be harmful/misleading.=C2=A0 If they are posted to
> a community place such as Emacs Wiki then they at least have
> a better chance of getting corrected and updated.
>
> And I really recommend _asking Emacs_ itself, including the
> manuals.=C2=A0 There is a good intro manual to learning Emacs Lisp
> that comes with Emacs.



--
Gravity never sleeps..
--001a1142833a9b0c0a0531531156--