help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: first steps in elisp


From: Thien-Thi Nguyen
Subject: Re: first steps in elisp
Date: Wed, 21 Dec 2016 18:57:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() 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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]