From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.bugs Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Date: Tue, 07 Feb 2017 07:22:51 +0100 Message-ID: <8737fqtt8k.fsf@mbork.pl> References: <55A74B3C.8030608@gmail.com> <83r3dln1ez.fsf@gnu.org> <87y47tzn0v.fsf@mbork.pl> <83lh3tmyzv.fsf@gnu.org> <87twihzhni.fsf@mbork.pl> <83fuu1mu25.fsf@gnu.org> <87eg9jynn0.fsf@mbork.pl> <83h9edkhjs.fsf@gnu.org> <874mabe5h6.fsf@mbork.pl> <83twibfil2.fsf@gnu.org> <87y47mcywp.fsf@mbork.pl> <87bmyrvzh1.fsf@mbork.pl> <878ttux198.fsf@mbork.pl> <366cfd22-c35c-4980-bc81-7f6df6c180a0@default> <87shra8hnz.fsf@mbork.pl> <87k2cj8z3w.fsf@mbork.pl> <87wpfppe09.fsf@mbork.pl> <42ff21f5-3df8-4935-b30d-b13b6bcd5f85@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486448593 30150 195.159.176.226 (7 Feb 2017 06:23:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2017 06:23:13 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.50.3 Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 07 07:23:08 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 1cazBE-0007fW-I0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Feb 2017 07:23:08 +0100 Original-Received: from localhost ([::1]:52239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cazBK-0003FM-3s for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Feb 2017 01:23:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cazBB-0003Df-Ki for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 01:23:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cazB8-00072m-Hm for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 01:23:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cazB8-00072h-Em for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 01:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cazB8-00047E-9G for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 01:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Feb 2017 06:23: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.148644853915755 (code B ref 21072); Tue, 07 Feb 2017 06:23:02 +0000 Original-Received: (at 21072) by debbugs.gnu.org; 7 Feb 2017 06:22:19 +0000 Original-Received: from localhost ([127.0.0.1]:58243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cazAR-000463-6W for submit@debbugs.gnu.org; Tue, 07 Feb 2017 01:22:19 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:44958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cazAP-00045v-Py for 21072@debbugs.gnu.org; Tue, 07 Feb 2017 01:22:18 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id AD76AE69C8; Tue, 7 Feb 2017 07:22:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M7ysli5k5TXy; Tue, 7 Feb 2017 07:22:14 +0100 (CET) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 9155CE664C; Tue, 7 Feb 2017 07:22:13 +0100 (CET) In-reply-to: <42ff21f5-3df8-4935-b30d-b13b6bcd5f85@default> 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:129056 Archived-At: Hi Drew, hi all, sorry for the delay - as I mentioned last time, I was going to have a very busy semester, which now came to an end - and hence I'm back. On 2016-11-27, at 19:51, Drew Adams wrote: > Again, thanks for working on this. > >> (defun in-comment-line-p () >> "Return non-nil if the point is in a comment line. >> See http://lists.gnu.org/archive/html/help-gnu-emacs/2016- >> 08/msg00141.html" > > The second doc-string sentence should just be a comment in the > code, if it is needed at all. Done, thanks. > >> If the mark is active, it marks the next defun after the one(s) >> already marked. With positive ARG, mark that many more defuns. > > more -> next Done, thanks. > >> ;; Trick with 'mark-defun-back due to Drew Adams > > No need for the attribution. ;-) Why not;-)? I'll change it to a link to your message, however - this might be actually more useful for future developers. > I didn't really test, but for this: > > (defun a () > nil) > (defun b () > nil) > ;;;; > (defun c () > nil) > > With point anywhere in either of the last two defuns or > on the comment line between them, `M-- C-M-h' selects not > only the expected defun but also the last line of the > defun before it. > > E.g., with point at the beginning of the comment line, > this is selected: > > nil) > (defun a () > nil) Yep, you're right. However, this seems to be a strange feature of beginning-of-defun. Place the point at the very same place at say M-: (beginning-of-defun 0). See? Since I guess almost nobody follows this discussion anymore, I'll ask about it in a separate thread on emacs-devel. The question remains, however: should I "fix" beginning-of-defun or just circumvent this behavior in my code? Best, -- Marcin Borkowski