From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.bugs Subject: bug#21072: Brave new mark-defun (and a testing tool) Date: Wed, 19 Apr 2017 17:47:46 -0700 Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> <87efyze00g.fsf@jane> <87bmu2eoji.fsf@jane> <87wpcpw61w.fsf@jane> <83o9xdghmc.fsf@gnu.org> <87o9wkoald.fsf@jane> <87a881ofsu.fsf@jane> <87k272wh8x.fsf@users.sourceforge.net> <871st4aal7.fsf@jane> <87tw5l7v26.fsf@jane> <877f2hs1nw.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1492649358 12941 195.159.176.226 (20 Apr 2017 00:49:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Apr 2017 00:49:18 +0000 (UTC) Cc: Marcin Borkowski , Stefan Monnier , Noam Postavsky To: 21072@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 20 02:49:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d10HZ-0003AC-7n for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Apr 2017 02:49:13 +0200 Original-Received: from localhost ([::1]:51114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d10Hb-0003Kb-VD for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Apr 2017 20:49:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d10HS-0003Ip-Gd for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 20:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d10HO-0001ux-JE for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 20:49:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59493) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d10HO-0001ur-EQ for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 20:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d10HO-0003ha-2j for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2017 20:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Mastro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Apr 2017 00:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149264929314168 (code B ref 21072); Thu, 20 Apr 2017 00:49:02 +0000 Original-Received: (at 21072) by debbugs.gnu.org; 20 Apr 2017 00:48:13 +0000 Original-Received: from localhost ([127.0.0.1]:57692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d10Gb-0003gS-IN for submit@debbugs.gnu.org; Wed, 19 Apr 2017 20:48:13 -0400 Original-Received: from mail-qk0-f172.google.com ([209.85.220.172]:34160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d10Ga-0003gG-TK for 21072@debbugs.gnu.org; Wed, 19 Apr 2017 20:48:13 -0400 Original-Received: by mail-qk0-f172.google.com with SMTP id y63so4157326qkd.1 for <21072@debbugs.gnu.org>; Wed, 19 Apr 2017 17:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RqU9dEnrxzBjBbhxZMdFfo+4rAcEH8JmM/D9SjYefYo=; b=ndgqdqN9vzI3zFEM6GjnBtusg9Wt3xTFvwQZgx8SG3b8526Ldk3KBSlUNiA7Um6sm+ lgXqO5DZl5RkVjljrydjjjjUXCFqYdTSEOEt6oFdRrslygnynNbSm+mZ1RLAuVw1TLqD bOkEDCTQ+h0Iz91KlVqbOrItSRppmGcTdiWW721ErKF/ixQCmXaYJiL4pQc0JCHqNXpZ SNGfDm2qy7i+nvXZ3U0cOcbVtcm4LjeG7KBufqvV4l3Tds+rh0gAvgnlXQgj4wYMHxge Xfkcimejm4x7/zPe4tB3AYKG3PiRhu4VJ/dQAE+NH2cFJFQKOuxm89EvnQz8HXYYIihC Q4ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RqU9dEnrxzBjBbhxZMdFfo+4rAcEH8JmM/D9SjYefYo=; b=snSvCM01f3jx6Rq7AJvn9t5CkqD4CM60x1/iwYKCB/opK1CT0Cck24TFscU9dIu4LM W+2Ebi3+j4ZL+2PplscB/h3k92RXgWtGfG5VHRRbh6owMNcmqS/t4xc63EFD4h2RgodY HxtU+rtqCztpj0v/T1KIZ6yLSkFG6GKHg+ubxG2fiZZDHBw0vXGe4oh2mkDNaiO/smUL 1WwCzADEemnkofn7FAopg3wiHawLF6epSietwCZm1P5ZMRdkIB3D5A/eEWZm4UXjdg8w 9qB3ettueBqzFy9vQQ68GsZl1PcUMCakm2Z24OAJJxJGnK3iQ7kGavVj7GDSbQEHMFP8 xx7Q== X-Gm-Message-State: AN3rC/4BDc8EaPNVM/qh8uTLmV3RrNWLtYCbFgO7dmPMRjSGQi8D8yx/ XGQ5hNRyOr2QEBcdoHejA7dFRfx+ew== X-Received: by 10.55.46.198 with SMTP id u189mr5118251qkh.20.1492649287306; Wed, 19 Apr 2017 17:48:07 -0700 (PDT) Original-Received: by 10.237.32.9 with HTTP; Wed, 19 Apr 2017 17:47:46 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131784 Archived-At: John Mastro wrote: > Would it help to lean on (forward-comment -1) more? > > Something like this: > > (defun beginning-of-defun-comments (&optional arg) > (interactive "^p") > (let ((arg (or arg 1)) > point) > (beginning-of-defun arg) > (setq point (point)) > (while (not (eq point (setq point (progn (forward-comment -1) (point)))))) > (skip-chars-forward "[:space:]\r\n"))) > > Having to `skip-chars-forward' at the end seems a bit awkward, but I > think it does work on the recently mentioned JavaScript examples. I realized that `forward-comment' returns nil when something besides a comment or whitespace was found, so my idea boils down to: (defun beginning-of-defun-comments (&optional arg) (interactive "^p") (beginning-of-defun (or arg 1)) (while (forward-comment -1)) (skip-chars-forward "[:space:]\r\n"))