unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Thien-Thi Nguyen <ttn@gnu.org>
To: Mark Piffer <mark.piffer@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: first steps in elisp
Date: Wed, 21 Dec 2016 18:57:00 +0100	[thread overview]
Message-ID: <87a8bptbbn.fsf@zigzag.favinet> (raw)
In-Reply-To: <271a22de-593b-479d-a3d7-4aecbce934fb@googlegroups.com> (Mark Piffer's message of "Thu, 24 Nov 2016 15:00:59 -0800 (PST)")

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]


() Mark Piffer <mark.piffer@gmail.com>
() Thu, 24 Nov 2016 15:00:59 -0800 (PST)

   (defun ignore-multiline-comment (nlines)
     DOCSTRING
     (if (zerop nlines)
         nil
       (if (looking-at ".*?\\*/")
                   (progn
                     (goto-char (match-end 0))
                     (ignore-line-comments nlines))
         (beginning-of-line 2)
         (ignore-multiline-comment (1- nlines)))))

In addition to suggestions made by others, i would replace the
(current) recursion w/ iteration, so as to future-proof against
large ‘nlines’ (maybe the text has short multiline comments now,
but you never know what weirdness may inspire the programmer to
wax eloquent in the future :-D).

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (type via)
   (case type
     (technical (eq 'mailing-list via))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2016-12-21 17:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 23:00 first steps in elisp Mark Piffer
2016-11-25  5:39 ` Marcin Borkowski
2016-11-25  8:00 ` Joost Kremers
2016-12-21 17:57 ` Thien-Thi Nguyen [this message]
2017-04-12  6:26 ` Steve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8bptbbn.fsf@zigzag.favinet \
    --to=ttn@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mark.piffer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).