From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Raffaele Ricciardi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jul 2015 06:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 21072@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143702715121880 (code B ref -1); Thu, 16 Jul 2015 06:13:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jul 2015 06:12:31 +0000 Received: from localhost ([127.0.0.1]:50563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZFcPG-0005gp-KR for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54115) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZFcPD-0005gb-Rh for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFcP7-0004hr-G4 for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFcP7-0004hn-Dx for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFcP6-0001ZP-1E for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2015 02:12:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFcP2-0004gx-Qx for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2015 02:12:19 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:33103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFcP2-0004gh-Gr for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2015 02:12:16 -0400 Received: by widic2 with SMTP id ic2so6176073wid.0 for ; Wed, 15 Jul 2015 23:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=tNoZ9bCXsezadA8lEJcTjLb0n/fVhsHtrMk/SXJND2U=; b=tL27AZDnkZ+3GthGAcDi7XeiDANooiciTcoWNq/cw2BN26K3o0SUFhSxGk24TC/wbN 8AsncriQ3v21FzcO7MR30P/swbyWDvi26LaHhmHGzhY1bTsrNh9y2BkfFaeNhU6LRkE3 HlnPwzfPJWsW1ZLJjtEkQ72uhwNopgMAVH9fHx8982vEk/Z+uH4Usrsj0QPUDlk+LYzQ JEDvuV6Kwo0XHR8CfubLk0V+IJWE1e3KcAqX3COXwA5JIEp9i65kKJo8Yt7eG9Gflc+y OMIhGp6riWmtt8kdmjlMsoph/rzmj4+h3iYPjwPYo4BGKZT94RFXjphor29eXEJZ/3RV n7NQ== X-Received: by 10.194.8.40 with SMTP id o8mr15696743wja.100.1437027134608; Wed, 15 Jul 2015 23:12:14 -0700 (PDT) Received: from [192.168.1.129] (81.203.145.32.dyn.user.ono.com. [81.203.145.32]) by smtp.gmail.com with ESMTPSA id m4sm11204829wjb.37.2015.07.15.23.12.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 23:12:13 -0700 (PDT) From: Raffaele Ricciardi Message-ID: <55A74B3C.8030608@gmail.com> Date: Thu, 16 Jul 2015 08:12:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) Dear Emacs maintainers, the documentation for `mark-defun' says: The defun marked is the one that contains point or follows point. However, Emacs may mark the preceding defun instead, and it may mark an unrelated preceding comment along with the defun. Please follow this recipe: - emacs -Q - make sure that *scratch* contains the following code: ------------------------------------------------------------------------ ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun a () nil) (defun b () nil) ------------------------------------------------------------------------ - move point anywhere inside the second defun; - press `C-M-h' and Emacs will correctly mark the current defun; - press `C-g C-M-h' and Emacs will incorrectly mark the previous defun; - now move point anywhere inside the first definition; - press `C-M-h' and Emacs will correctly mark the current defun; - press `C-g C-M-h' and Emacs will incorrectly mark the defun along with the preceding comment; - now make sure that *scratch* contains the following code: ------------------------------------------------------------------------ ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun a () nil) ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun b () nil) ------------------------------------------------------------------------ - move point anywhere inside the second comment and press `C-M-h': Emacs will correctly mark the following defun; - move point anywhere inside the first comment and press `C-M-h': Emacs will incorrectly mark the comment along with the defun. Thanks for your attention. Best Regards. -- In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5) of 2015-06-23 on debian Windowing system distributor `The X.Org Foundation', version 11.0.11604000 System Description: Debian GNU/Linux 8.1 (jessie) Configured using: `configure --prefix=/opt/emacs/emacs-24.5' Important settings: value of $LC_MONETARY: en_GB.utf8 value of $LC_NUMERIC: en_GB.utf8 value of $LC_TIME: en_GB.utf8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Quit Mark set [2 times] Quit Mark set [2 times] Quit Mark set [2 times] Quit Mark set [2 times] Quit Mark set [2 times] Quit Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 73007 6360) (symbols 48 17564 0) (miscs 40 53 254) (strings 32 9482 4902) (string-bytes 1 268085) (vectors 16 8916) (vector-slots 8 383708 18759) (floats 8 64 360) (intervals 56 334 13) (buffers 960 11) (heap 1024 48896 861)) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Apr 2016 11:12:01 +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: To: Raffaele Ricciardi Cc: 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146158266916156 (code B ref 21072); Mon, 25 Apr 2016 11:12:01 +0000 Received: (at 21072) by debbugs.gnu.org; 25 Apr 2016 11:11:09 +0000 Received: from localhost ([127.0.0.1]:45690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aueQ1-0004CW-4Q for submit@debbugs.gnu.org; Mon, 25 Apr 2016 07:11:09 -0400 Received: from pp.amu.edu.pl ([150.254.65.67]:45324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1auePz-0004CN-3N for 21072@debbugs.gnu.org; Mon, 25 Apr 2016 07:11:07 -0400 Received: from localhost (pp.amu.edu.pl [127.0.0.1]) by pp.amu.edu.pl (Postfix) with ESMTP id F1BD7AA0E2; Mon, 25 Apr 2016 13:11:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=amu.edu.pl; h= content-type:content-type:mime-version:user-agent:message-id :in-reply-to:date:date:references:subject:subject:from:from :received:received; s=pp; t=1461582665; x=1463397066; bh=sSPm4PS peApBWKuSEk1XTHMlXqNe7IhMNnCnC21CYXY=; b=bfC3S41f5lxes8cBx38f1fB 7Y4gbc+d8oH5bDPmOnVe7vcA1rBzZ9b0978TkmnCkSXgDmSLigqxGm4RSqNtJCKB i815XMqf/z9yM4hzQaRJYycYU9CG/2Ksjl7akpNROhg1bLKjsuzkHPKy62t7Dxy3 dIdyJ1Jq+SY4rvo5oCkw= X-Virus-Scanned: amavisd-new at amu.edu.pl Received: from pp.amu.edu.pl ([127.0.0.1]) by localhost (pp.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yEzKJqwvWBVi; Mon, 25 Apr 2016 13:11:05 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by pp.amu.edu.pl (Postfix) with ESMTPSA id 6BB28AA0D8; Mon, 25 Apr 2016 13:11:05 +0200 (CEST) From: Marcin Borkowski References: <55A74B3C.8030608@gmail.com> Date: Mon, 25 Apr 2016 13:11:01 +0200 In-Reply-To: <55A74B3C.8030608@gmail.com> (Raffaele Ricciardi's message of "Thu, 16 Jul 2015 08:12:12 +0200") Message-ID: <87k2jm2bay.fsf@amu.edu.pl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.0 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2015-07-16, at 08:12, Raffaele Ricciardi wrote: > Dear Emacs maintainers, > > the documentation for `mark-defun' says: > > The defun marked is the one that contains point or follows point. > > However, Emacs may mark the preceding defun instead, and it may > mark an unrelated preceding comment along with the defun. Confirmed on GNU Emacs 25.1.50.8 (commit 912e915). Best, -- Marcin From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 17:18:01 +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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146212304912845 (code B ref 21072); Sun, 01 May 2016 17:18:01 +0000 Received: (at 21072) by debbugs.gnu.org; 1 May 2016 17:17:29 +0000 Received: from localhost ([127.0.0.1]:60893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awuzp-0003L7-Lb for submit@debbugs.gnu.org; Sun, 01 May 2016 13:17:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awuzp-0003Kw-0g for 21072@debbugs.gnu.org; Sun, 01 May 2016 13:17:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awuza-0001wl-7a for 21072@debbugs.gnu.org; Sun, 01 May 2016 13:17:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awuza-0001wC-4N; Sun, 01 May 2016 13:17:14 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2755 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1awuzU-0003vL-3G; Sun, 01 May 2016 13:17:08 -0400 Date: Sun, 01 May 2016 20:17:08 +0300 Message-Id: <83r3dln1ez.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87k2jm2bay.fsf@amu.edu.pl> (message from Marcin Borkowski on Mon, 25 Apr 2016 13:11:01 +0200) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Marcin Borkowski > Date: Mon, 25 Apr 2016 13:11:01 +0200 > Cc: 21072@debbugs.gnu.org > > On 2015-07-16, at 08:12, Raffaele Ricciardi wrote: > > > Dear Emacs maintainers, > > > > the documentation for `mark-defun' says: > > > > The defun marked is the one that contains point or follows point. > > > > However, Emacs may mark the preceding defun instead, and it may > > mark an unrelated preceding comment along with the defun. > > Confirmed on GNU Emacs 25.1.50.8 (commit 912e915). FWIW, I don't see why the behavior flagged "incorrect" is deemed incorrect. It looks correct to me. In all of those examples point is between 2 functions, so what exactly is "correct" is open to discussion. Am I missing something? From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 17:50:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146212498422313 (code B ref 21072); Sun, 01 May 2016 17:50:01 +0000 Received: (at 21072) by debbugs.gnu.org; 1 May 2016 17:49:44 +0000 Received: from localhost ([127.0.0.1]:60936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awvV2-0005np-H0 for submit@debbugs.gnu.org; Sun, 01 May 2016 13:49:44 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:56267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awvV0-0005nh-FW for 21072@debbugs.gnu.org; Sun, 01 May 2016 13:49:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 2F113B24930; Sun, 1 May 2016 19:49:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 N-SdigJJkngG; Sun, 1 May 2016 19:49:37 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 80A3CB2492E; Sun, 1 May 2016 19:49:37 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <83r3dln1ez.fsf@gnu.org> User-agent: mu4e 0.9.13; emacs 25.1.50.9 From: Marcin Borkowski In-reply-to: <83r3dln1ez.fsf@gnu.org> Date: Sun, 01 May 2016 19:49:36 +0200 Message-ID: <87y47tzn0v.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-01, at 19:17, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Date: Mon, 25 Apr 2016 13:11:01 +0200 >> Cc: 21072@debbugs.gnu.org >> >> On 2015-07-16, at 08:12, Raffaele Ricciardi wrote: >> >> > Dear Emacs maintainers, >> > >> > the documentation for `mark-defun' says: >> > >> > The defun marked is the one that contains point or follows point. >> > >> > However, Emacs may mark the preceding defun instead, and it may >> > mark an unrelated preceding comment along with the defun. >> >> Confirmed on GNU Emacs 25.1.50.8 (commit 912e915). > > FWIW, I don't see why the behavior flagged "incorrect" is deemed > incorrect. It looks correct to me. In all of those examples point is > between 2 functions, so what exactly is "correct" is open to > discussion. > > Am I missing something? Yes. Here's a fragment from `mark-defun''s docstring: --8<---------------cut here---------------start------------->8--- Put mark at end of this defun, point at beginning. The defun marked is the one that contains point or follows point. --8<---------------cut here---------------end--------------->8--- And from the Emacs manual: --8<---------------cut here---------------start------------->8--- If you use the command while point is between defuns, it uses the following defun. --8<---------------cut here---------------end--------------->8--- So IMHO it's not "open to discussion" - the behavior is different than described in both the docstring (a bit implicitly) or in the manual (explicitly). Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 18:10:01 +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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146212618530505 (code B ref 21072); Sun, 01 May 2016 18:10:01 +0000 Received: (at 21072) by debbugs.gnu.org; 1 May 2016 18:09:45 +0000 Received: from localhost ([127.0.0.1]:60960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awvoP-0007vx-Ia for submit@debbugs.gnu.org; Sun, 01 May 2016 14:09:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awvoO-0007vk-8p for 21072@debbugs.gnu.org; Sun, 01 May 2016 14:09:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awvo9-0005AZ-PL for 21072@debbugs.gnu.org; Sun, 01 May 2016 14:09:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awvo9-00059w-M8; Sun, 01 May 2016 14:09:29 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2785 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1awvo3-0001tF-G9; Sun, 01 May 2016 14:09:23 -0400 Date: Sun, 01 May 2016 21:09:24 +0300 Message-Id: <83lh3tmyzv.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87y47tzn0v.fsf@mbork.pl> (message from Marcin Borkowski on Sun, 01 May 2016 19:49:36 +0200) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <83r3dln1ez.fsf@gnu.org> <87y47tzn0v.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Marcin Borkowski > Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org > Date: Sun, 01 May 2016 19:49:36 +0200 > > --8<---------------cut here---------------start------------->8--- > Put mark at end of this defun, point at beginning. > The defun marked is the one that contains point or follows point. > --8<---------------cut here---------------end--------------->8--- So if we say "either precedes or follows point" instead of "follows point", all will be well? From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 19:46:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146213194725492 (code B ref 21072); Sun, 01 May 2016 19:46:01 +0000 Received: (at 21072) by debbugs.gnu.org; 1 May 2016 19:45:47 +0000 Received: from localhost ([127.0.0.1]:32779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awxJL-0006d6-5v for submit@debbugs.gnu.org; Sun, 01 May 2016 15:45:47 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:59052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awxJJ-0006cx-4y for 21072@debbugs.gnu.org; Sun, 01 May 2016 15:45:45 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id CCDEFB2560C; Sun, 1 May 2016 21:45:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 DVElyMXTK8Kv; Sun, 1 May 2016 21:45:38 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 64044B2560A; Sun, 1 May 2016 21:45:38 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <83r3dln1ez.fsf@gnu.org> <87y47tzn0v.fsf@mbork.pl> <83lh3tmyzv.fsf@gnu.org> User-agent: mu4e 0.9.13; emacs 25.1.50.9 From: Marcin Borkowski In-reply-to: <83lh3tmyzv.fsf@gnu.org> Date: Sun, 01 May 2016 21:45:37 +0200 Message-ID: <87twihzhni.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-01, at 20:09, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >> Date: Sun, 01 May 2016 19:49:36 +0200 >> >> --8<---------------cut here---------------start------------->8--- >> Put mark at end of this defun, point at beginning. >> The defun marked is the one that contains point or follows point. >> --8<---------------cut here---------------end--------------->8--- > > So if we say "either precedes or follows point" instead of "follows > point", all will be well? Formally, yes. Though I guess it would be a bit better to fix the commands so that it's behavior matches the docs. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 19:57: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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146213258426456 (code B ref 21072); Sun, 01 May 2016 19:57:02 +0000 Received: (at 21072) by debbugs.gnu.org; 1 May 2016 19:56:24 +0000 Received: from localhost ([127.0.0.1]:32791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awxTc-0006se-1l for submit@debbugs.gnu.org; Sun, 01 May 2016 15:56:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awxTa-0006sQ-Db for 21072@debbugs.gnu.org; Sun, 01 May 2016 15:56:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awxTL-0002Gc-VI for 21072@debbugs.gnu.org; Sun, 01 May 2016 15:56:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awxTL-0002Fh-Rr; Sun, 01 May 2016 15:56:07 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2869 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1awxTF-0006Ra-F6; Sun, 01 May 2016 15:56:02 -0400 Date: Sun, 01 May 2016 22:56:02 +0300 Message-Id: <83fuu1mu25.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87twihzhni.fsf@mbork.pl> (message from Marcin Borkowski on Sun, 01 May 2016 21:45:37 +0200) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <83r3dln1ez.fsf@gnu.org> <87y47tzn0v.fsf@mbork.pl> <83lh3tmyzv.fsf@gnu.org> <87twihzhni.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Marcin Borkowski > Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org > Date: Sun, 01 May 2016 21:45:37 +0200 > > > So if we say "either precedes or follows point" instead of "follows > > point", all will be well? > > Formally, yes. Though I guess it would be a bit better to fix the > commands so that it's behavior matches the docs. Why do you think that? Why is it better to always mark the function that follows point? Me, I think that the current behavior is a kind of feature, since it lets the user control whether the leading commentary before a function will or won't be marked. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2016 18:59: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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146230191714510 (code B ref 21072); Tue, 03 May 2016 18:59:02 +0000 Received: (at 21072) by debbugs.gnu.org; 3 May 2016 18:58:37 +0000 Received: from localhost ([127.0.0.1]:35675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axfWn-0003ly-AJ for submit@debbugs.gnu.org; Tue, 03 May 2016 14:58:37 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:48689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axfWl-0003lq-IJ for 21072@debbugs.gnu.org; Tue, 03 May 2016 14:58:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 3CB55B3044A; Tue, 3 May 2016 20:58:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 EQziLy9jg5m1; Tue, 3 May 2016 20:58:31 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 6D880B30447; Tue, 3 May 2016 20:58:31 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <83r3dln1ez.fsf@gnu.org> <87y47tzn0v.fsf@mbork.pl> <83lh3tmyzv.fsf@gnu.org> <87twihzhni.fsf@mbork.pl> <83fuu1mu25.fsf@gnu.org> User-agent: mu4e 0.9.13; emacs 25.1.50.9 From: Marcin Borkowski In-reply-to: <83fuu1mu25.fsf@gnu.org> Date: Tue, 03 May 2016 20:58:27 +0200 Message-ID: <87eg9jynn0.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-01, at 21:56, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >> Date: Sun, 01 May 2016 21:45:37 +0200 >> >> > So if we say "either precedes or follows point" instead of "follows >> > point", all will be well? >> >> Formally, yes. Though I guess it would be a bit better to fix the >> commands so that it's behavior matches the docs. > > Why do you think that? Why is it better to always mark the function > that follows point? I don't know, I don't use `mark-defun' personally. My train of thought was that if someone wrote something like that inthe docs, s?he thought it was reasonable. > Me, I think that the current behavior is a kind of feature, since it > lets the user control whether the leading commentary before a function > will or won't be marked. I don't understand that. How do I control that? Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 May 2016 14:47: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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146237317613885 (code B ref 21072); Wed, 04 May 2016 14:47:02 +0000 Received: (at 21072) by debbugs.gnu.org; 4 May 2016 14:46:16 +0000 Received: from localhost ([127.0.0.1]:37818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axy48-0003bs-Kx for submit@debbugs.gnu.org; Wed, 04 May 2016 10:46:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axy46-0003be-TK for 21072@debbugs.gnu.org; Wed, 04 May 2016 10:46:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axy3r-00062z-9I for 21072@debbugs.gnu.org; Wed, 04 May 2016 10:46:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axy3r-00062B-6H; Wed, 04 May 2016 10:45:59 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2140 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1axy3k-0006MC-QA; Wed, 04 May 2016 10:45:53 -0400 Date: Wed, 04 May 2016 17:45:59 +0300 Message-Id: <83h9edkhjs.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87eg9jynn0.fsf@mbork.pl> (message from Marcin Borkowski on Tue, 03 May 2016 20:58:27 +0200) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <83r3dln1ez.fsf@gnu.org> <87y47tzn0v.fsf@mbork.pl> <83lh3tmyzv.fsf@gnu.org> <87twihzhni.fsf@mbork.pl> <83fuu1mu25.fsf@gnu.org> <87eg9jynn0.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.1 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.1 (-------) > From: Marcin Borkowski > Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org > Date: Tue, 03 May 2016 20:58:27 +0200 > > > Me, I think that the current behavior is a kind of feature, since it > > lets the user control whether the leading commentary before a function > > will or won't be marked. > > I don't understand that. How do I control that? By invoking the command before or after the commentary that precedes a function. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 May 2016 12:28:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146253768021215 (code B ref 21072); Fri, 06 May 2016 12:28:01 +0000 Received: (at 21072) by debbugs.gnu.org; 6 May 2016 12:28:00 +0000 Received: from localhost ([127.0.0.1]:41215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayerP-0005W6-Ru for submit@debbugs.gnu.org; Fri, 06 May 2016 08:28:00 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:58810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayerO-0005Vx-23 for 21072@debbugs.gnu.org; Fri, 06 May 2016 08:27:58 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id AFF6BB3F824; Fri, 6 May 2016 14:27:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 Pm1yoyVDwqV1; Fri, 6 May 2016 14:27:54 +0200 (CEST) Received: from localhost (unknown [IPv6:2001:808:114:6:a288:b4ff:fe90:5e24]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3ACBCB3F81F; Fri, 6 May 2016 14:27:54 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.13; emacs 25.1.50.9 From: Marcin Borkowski In-reply-to: <83h9edkhjs.fsf@gnu.org> Date: Fri, 06 May 2016 14:27:49 +0200 Message-ID: <874mabe5h6.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-04, at 16:45, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >> Date: Tue, 03 May 2016 20:58:27 +0200 >> >> > Me, I think that the current behavior is a kind of feature, since it >> > lets the user control whether the leading commentary before a function >> > will or won't be marked. >> >> I don't understand that. How do I control that? > > By invoking the command before or after the commentary that precedes a > function. Sorry, but I still don't get it. (I think this means at least that the docs need rewording.) Take this text: --8<---------------cut here---------------start------------->8--- (defun spam () (spam)) ;; Lorem ipsum (defun lorem-ipsum () "Lorem ipsum." (message "Lorem ipsum.")) --8<---------------cut here---------------end--------------->8--- How do I place point so that `mark-defun' would mark `lorem-ipsum' together with the comment before? Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 May 2016 13:00: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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146253957124135 (code B ref 21072); Fri, 06 May 2016 13:00:02 +0000 Received: (at 21072) by debbugs.gnu.org; 6 May 2016 12:59:31 +0000 Received: from localhost ([127.0.0.1]:41233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayfLu-0006HD-US for submit@debbugs.gnu.org; Fri, 06 May 2016 08:59:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayfLt-0006H1-HP for 21072@debbugs.gnu.org; Fri, 06 May 2016 08:59:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayfLe-0003cq-Lf for 21072@debbugs.gnu.org; Fri, 06 May 2016 08:59:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayfLe-0003bR-J3; Fri, 06 May 2016 08:59:14 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2786 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ayfLY-0005Qc-B6; Fri, 06 May 2016 08:59:08 -0400 Date: Fri, 06 May 2016 15:59:21 +0300 Message-Id: <83twibfil2.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <874mabe5h6.fsf@mbork.pl> (message from Marcin Borkowski on Fri, 06 May 2016 14:27:49 +0200) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.1 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.1 (-------) > From: Marcin Borkowski > Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org > Date: Fri, 06 May 2016 14:27:49 +0200 > > (defun spam () > (spam)) > > ;; Lorem ipsum > (defun lorem-ipsum () > "Lorem ipsum." > (message "Lorem ipsum.")) > --8<---------------cut here---------------end--------------->8--- > > How do I place point so that `mark-defun' would mark `lorem-ipsum' > together with the comment before? I'm sorry, I no longer remember. It's hard to communicate when days pass between messages. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 May 2016 03:48:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146259287022680 (code B ref 21072); Sat, 07 May 2016 03:48:01 +0000 Received: (at 21072) by debbugs.gnu.org; 7 May 2016 03:47:50 +0000 Received: from localhost ([127.0.0.1]:42180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aytDZ-0005tk-SA for submit@debbugs.gnu.org; Fri, 06 May 2016 23:47:50 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:45707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aytDX-0005tb-8m for 21072@debbugs.gnu.org; Fri, 06 May 2016 23:47:48 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9886AB42F1C; Sat, 7 May 2016 05:47:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 L9S9oSx0ifsB; Sat, 7 May 2016 05:47:22 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 7B67BB42F13; Sat, 7 May 2016 05:47:22 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.13; emacs 25.1.50.9 From: Marcin Borkowski In-reply-to: <83twibfil2.fsf@gnu.org> Date: Sat, 07 May 2016 05:47:18 +0200 Message-ID: <87y47mcywp.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-06, at 14:59, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >> Date: Fri, 06 May 2016 14:27:49 +0200 >> >> (defun spam () >> (spam)) >> >> ;; Lorem ipsum >> (defun lorem-ipsum () >> "Lorem ipsum." >> (message "Lorem ipsum.")) >> --8<---------------cut here---------------end--------------->8--- >> >> How do I place point so that `mark-defun' would mark `lorem-ipsum' >> together with the comment before? > > I'm sorry, I no longer remember. It's hard to communicate when days > pass between messages. I'm really sorry, but for me the asynchronicity of email and the possibility of responding after a few days/weeks instead of a few minutes is one of the main advantages of email as such (as opposed to "tools" like Facebook, which I consider more of "toys", also because of the difficulty to spread the conversation to weeks). I can only spend that much time on Emacs bugs each day - similarly with other things - and I often respond after long time (especially if the response needs some time/effort to compose). I'm not sure what to do next with this bug. I tried with the abovementioned short Elisp file and failed. Since no-one said that the current behavior is wrong, maybe I'll try to study the code of `mark-defun' and modify the docstring/manual accordingly. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 May 2016 05:08:01 +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: To: Marcin Borkowski , Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146259765030718 (code B ref 21072); Sat, 07 May 2016 05:08:01 +0000 Received: (at 21072) by debbugs.gnu.org; 7 May 2016 05:07:30 +0000 Received: from localhost ([127.0.0.1]:42219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayuSg-0007zO-GE for submit@debbugs.gnu.org; Sat, 07 May 2016 01:07:30 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:31131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayuSe-0007z7-6A for 21072@debbugs.gnu.org; Sat, 07 May 2016 01:07:28 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u4757KW7015124 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 7 May 2016 05:07:20 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u4757JGr012011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 7 May 2016 05:07:20 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u4757EQU028251; Sat, 7 May 2016 05:07:18 GMT MIME-Version: 1.0 Message-ID: Date: Fri, 6 May 2016 22:07:13 -0700 (PDT) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <87y47mcywp.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -4.4 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) I agree that the behavior is not particularly consistent, and it does not completely correspond to the doc. What the best fix is, I don't know. It's been this way for a long time, so there might be people who expect or like it to do what it does, in which case the doc should probably be fixed somewhat. On the other hand, I'd bet that few, if any, would complain if better behavior were implemented. In any case, the behavior of being able to repeat to keep selecting more defuns further down should be kept. I'd suggest that Someone (TM) (Marcin?) implement a better behavior and propose it to emacs-devel. ;-) What might be better? 1. At least consistency wrt which defun gets selected, when betweeen defuns. The doc suggests a general rule (the next defun), but that is not always respected. 2. Something consistent also wrt a comment before the defun that will be selected. 3. It could be good for a numeric prefix arg to select that many defuns. 4. It could be good for a negative prefix arg to select in the opposite direction. This is the main improvement I'd like to see. E.g. `M-- C-M-h' selects the previous defun; `M-2 C-M-h' selects the two previous defuns. Someone should play around and dream up something useful. Wrt #2, I'm not sure what the best approach might be. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 May 2016 06:48:01 +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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14626036377893 (code B ref 21072); Sat, 07 May 2016 06:48:01 +0000 Received: (at 21072) by debbugs.gnu.org; 7 May 2016 06:47:17 +0000 Received: from localhost ([127.0.0.1]:42225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayw1F-00023F-70 for submit@debbugs.gnu.org; Sat, 07 May 2016 02:47:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayw1D-000234-UW for 21072@debbugs.gnu.org; Sat, 07 May 2016 02:47:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayw15-0002gK-Jn for 21072@debbugs.gnu.org; Sat, 07 May 2016 02:47:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayw15-0002gG-Ga; Sat, 07 May 2016 02:47:07 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3651 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ayw13-0003ug-D9; Sat, 07 May 2016 02:47:05 -0400 Date: Sat, 07 May 2016 09:47:21 +0300 Message-Id: <83a8k2fjpi.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87y47mcywp.fsf@mbork.pl> (message from Marcin Borkowski on Sat, 07 May 2016 05:47:18 +0200) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.1 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.1 (-------) > From: Marcin Borkowski > Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org > Date: Sat, 07 May 2016 05:47:18 +0200 > > I'm not sure what to do next with this bug. I tried with the > abovementioned short Elisp file and failed. Since no-one said that the > current behavior is wrong, maybe I'll try to study the code of > `mark-defun' and modify the docstring/manual accordingly. I'd suggest to change the doc string according to what I recommended a few messages ago. I think that would be good enough. Thanks. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jun 2016 06:31:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146510822332355 (code B ref 21072); Sun, 05 Jun 2016 06:31:01 +0000 Received: (at 21072) by debbugs.gnu.org; 5 Jun 2016 06:30:23 +0000 Received: from localhost ([127.0.0.1]:54851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9RZn-0008Pm-79 for submit@debbugs.gnu.org; Sun, 05 Jun 2016 02:30:23 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:59873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9RZj-0008Pa-W0 for 21072@debbugs.gnu.org; Sun, 05 Jun 2016 02:30:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id AC7B8BDE19C; Sun, 5 Jun 2016 08:30:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 GUWvIdWZuRlV; Sun, 5 Jun 2016 08:30:10 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3DEA6BDE192; Sun, 5 Jun 2016 08:30:10 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <83a8k2fjpi.fsf@gnu.org> User-agent: mu4e 0.9.16; emacs 25.1.50.3 From: Marcin Borkowski In-reply-to: <83a8k2fjpi.fsf@gnu.org> Date: Sun, 05 Jun 2016 08:30:11 +0200 Message-ID: <87y46kb11o.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-07, at 08:47, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >> Date: Sat, 07 May 2016 05:47:18 +0200 >> >> I'm not sure what to do next with this bug. I tried with the >> abovementioned short Elisp file and failed. Since no-one said that the >> current behavior is wrong, maybe I'll try to study the code of >> `mark-defun' and modify the docstring/manual accordingly. > > I'd suggest to change the doc string according to what I recommended a > few messages ago. I think that would be good enough. Hi Eli, hi all, and sorry for replying after such a long time (again) - I'm afraid I cannot help this, my time has become extremely limited recently. I studied the code of mark-defun, and it seems that the reason for #21072 is quite simple. I enclose a patch where the two (seemingly) offending lines are commented; if this is acceptable, of course I'll prepare a proper patch. (And while at that, I'll propose replacing `(and transient-mark-mode mark-active)' with `(use-region-p)'.) The problem is, I'm not sure whether this change won't break anything. The only tests I found that deal with `mark-defun' are in python-tests.el, and my version passes all three of them. > Thanks. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Forgotten attachment (was: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jun 2016 07:02:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14651100872798 (code B ref 21072); Sun, 05 Jun 2016 07:02:01 +0000 Received: (at 21072) by debbugs.gnu.org; 5 Jun 2016 07:01:27 +0000 Received: from localhost ([127.0.0.1]:54855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9S3q-0000j4-Qu for submit@debbugs.gnu.org; Sun, 05 Jun 2016 03:01:27 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:60414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9S3p-0000iw-4q for 21072@debbugs.gnu.org; Sun, 05 Jun 2016 03:01:25 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 41B94BDE3DF; Sun, 5 Jun 2016 09:01:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 m9LKZsb8vVSc; Sun, 5 Jun 2016 09:01:19 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id D7A94BDE3DA; Sun, 5 Jun 2016 09:01:18 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <83a8k2fjpi.fsf@gnu.org> <87y46kb11o.fsf@mbork.pl> User-agent: mu4e 0.9.16; emacs 25.1.50.3 From: Marcin Borkowski In-reply-to: <87y46kb11o.fsf@mbork.pl> Date: Sun, 05 Jun 2016 09:01:17 +0200 Message-ID: <87h9d8i0g2.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain And a forgotten attachment. On 2016-06-05, at 08:30, Marcin Borkowski wrote: > On 2016-05-07, at 08:47, Eli Zaretskii wrote: > >>> From: Marcin Borkowski >>> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >>> Date: Sat, 07 May 2016 05:47:18 +0200 >>> >>> I'm not sure what to do next with this bug. I tried with the >>> abovementioned short Elisp file and failed. Since no-one said that the >>> current behavior is wrong, maybe I'll try to study the code of >>> `mark-defun' and modify the docstring/manual accordingly. >> >> I'd suggest to change the doc string according to what I recommended a >> few messages ago. I think that would be good enough. > > Hi Eli, hi all, > > and sorry for replying after such a long time (again) - I'm afraid > I cannot help this, my time has become extremely limited recently. > > I studied the code of mark-defun, and it seems that the reason for > #21072 is quite simple. I enclose a patch where the two (seemingly) > offending lines are commented; if this is acceptable, of course I'll > prepare a proper patch. (And while at that, I'll propose replacing > `(and transient-mark-mode mark-active)' with `(use-region-p)'.) > > The problem is, I'm not sure whether this change won't break anything. > The only tests I found that deal with `mark-defun' are in > python-tests.el, and my version passes all three of them. > >> Thanks. > > Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-bug-21072.patch >From e717c6e8a1a0645baa8ea1a3dc965bac9fe9b540 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Sun, 5 Jun 2016 08:25:36 +0200 Subject: [PATCH] Fix bug#21072 --- lisp/emacs-lisp/lisp.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index ea7cce6..4b98b80 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -505,8 +505,9 @@ mark-defun (setq beg (point)) (end-of-defun) (setq end (point)) - (while (looking-at "^\n") - (forward-line 1)) + ;; The two lines below seemingly caused bug#21072. + ;; (while (looking-at "^\n") + ;; (forward-line 1)) (if (> (point) opoint) (progn ;; We got the right defun. -- 2.8.3 --=-=-=-- From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Jun 2016 11:57:01 +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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14654733962923 (code B ref 21072); Thu, 09 Jun 2016 11:57:01 +0000 Received: (at 21072) by debbugs.gnu.org; 9 Jun 2016 11:56:36 +0000 Received: from localhost ([127.0.0.1]:33380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAyZf-0000l5-QS for submit@debbugs.gnu.org; Thu, 09 Jun 2016 07:56:36 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:55737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAyZc-0000ku-1v for 21072@debbugs.gnu.org; Thu, 09 Jun 2016 07:56:34 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 7843FBF46BF; Thu, 9 Jun 2016 13:56:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 rKliI6LzhFLW; Thu, 9 Jun 2016 13:56:28 +0200 (CEST) Received: from localhost (unknown [150.254.81.11]) by mail.mojserwer.eu (Postfix) with ESMTPSA id C66E6BF46B9; Thu, 9 Jun 2016 13:56:27 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <83a8k2fjpi.fsf@gnu.org> <87y46kb11o.fsf@mbork.pl> User-agent: mu4e 0.9.16; emacs 25.1.50.3 From: Marcin Borkowski Message-ID: <8737omh8yk.fsf@amu.edu.pl> In-reply-to: <87y46kb11o.fsf@mbork.pl> Date: Thu, 09 Jun 2016 13:56:25 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Hi everyone, it's me again. I looked at the tests of `mark-defun' for Python, and they did shed some light on the weird implementation. In short, `mark-defun' first jumps to the beginning and the to the end of the current defun, checks whether the point is now before or after the initial position, and if before, back up and jump to the end first and to the beginning next. This might actually happen, since e.g. in Python, when point is on a "def" beginning a function definition, `beginning-of-defun' goes to the start of the _preceding_ defun. In fact, I think this is a bug in beginning-of-defun (or more precisely, its Python version), and consequently I think the weird code in `mark-defun' is a workaround for a deeper bug. I can now do one of a few things. (Not ATM, I'll have to take my time.) 1. Fix the docs so that #21072 is no longer a bug (i.e., change the docs so that there's no discrepancy between them and code). 2a. Just fix the problem reported in #21072, hoping that it doesn't break anything else. 2b. Write a few tests for `mark-defun',_then_ fix the problem, and check whether these tests pass. Of course, all these tests would be for Elisp (and maybe for C and/or JavaScript). 3. Try to come up with a better `mark-defun', still given the limitations of `beginning-of-defun', e.g., make `mark-defun' use the numeric prefix argument in a reasonable way (i.e., what Drew proposed). 4. Report a bug in `beginning-of-defun', and hope someone (probably not me, I do not know enough about ppss now and do not have time to learn that now), and then write a simpler `mark-defun' from scratch. WDYT? Best, Marcin On 2016-06-05, at 08:30, Marcin Borkowski wrote: > On 2016-05-07, at 08:47, Eli Zaretskii wrote: > >>> From: Marcin Borkowski >>> Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org >>> Date: Sat, 07 May 2016 05:47:18 +0200 >>> >>> I'm not sure what to do next with this bug. I tried with the >>> abovementioned short Elisp file and failed. Since no-one said that the >>> current behavior is wrong, maybe I'll try to study the code of >>> `mark-defun' and modify the docstring/manual accordingly. >> >> I'd suggest to change the doc string according to what I recommended a >> few messages ago. I think that would be good enough. > > Hi Eli, hi all, > > and sorry for replying after such a long time (again) - I'm afraid > I cannot help this, my time has become extremely limited recently. > > I studied the code of mark-defun, and it seems that the reason for > #21072 is quite simple. I enclose a patch where the two (seemingly) > offending lines are commented; if this is acceptable, of course I'll > prepare a proper patch. (And while at that, I'll propose replacing > `(and transient-mark-mode mark-active)' with `(use-region-p)'.) > > The problem is, I'm not sure whether this change won't break anything. > The only tests I found that deal with `mark-defun' are in > python-tests.el, and my version passes all three of them. > >> Thanks. > > Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2016 08:00: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: To: Eli Zaretskii Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14664959437158 (code B ref 21072); Tue, 21 Jun 2016 08:00:02 +0000 Received: (at 21072) by debbugs.gnu.org; 21 Jun 2016 07:59:03 +0000 Received: from localhost ([127.0.0.1]:48506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFGaI-0001r1-Ph for submit@debbugs.gnu.org; Tue, 21 Jun 2016 03:59:03 -0400 Received: from pp.amu.edu.pl ([150.254.65.67]:35610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFGaG-0001qm-CF for 21072@debbugs.gnu.org; Tue, 21 Jun 2016 03:58:57 -0400 Received: from localhost (pp.amu.edu.pl [127.0.0.1]) by pp.amu.edu.pl (Postfix) with ESMTP id 63980ABF6E; Tue, 21 Jun 2016 09:58:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=amu.edu.pl; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:in-reply-to:subject:subject:from:from :user-agent:references:received:received; s=pp; t=1466495928; x= 1468310329; bh=Y1Q8bW5BJ1QW/gm+GYQwNcYqt40Jc74r2z8mLtGYCns=; b=L PsILiCx3I7M7keyT6Vezq7hgQRz60ZLOEcBYObt/0blp0iR2ANZGCu89cmdeEVgS kPVXieo0E90qinWvmWjl3lKBedCTyzt2HNCFmwwlQeC7ItDJfM3yOXC+X7CsEUBc Y+HShIs6eurQACTNLwsLWaDkN25FneklWvBXrC6nGI= X-Virus-Scanned: amavisd-new at amu.edu.pl Received: from pp.amu.edu.pl ([127.0.0.1]) by localhost (pp.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JK8Hptxkk5WJ; Tue, 21 Jun 2016 09:58:48 +0200 (CEST) Received: from localhost (188.146.135.147.nat.umts.dynamic.t-mobile.pl [188.146.135.147]) by pp.amu.edu.pl (Postfix) with ESMTPSA id 4061DABEC9; Tue, 21 Jun 2016 09:58:47 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <83a8k2fjpi.fsf@gnu.org> <87y46kb11o.fsf@mbork.pl> <8737omh8yk.fsf@amu.edu.pl> User-agent: mu4e 0.9.16; emacs 25.1.50.3 From: Marcin Borkowski In-reply-to: <8737omh8yk.fsf@amu.edu.pl> Date: Tue, 21 Jun 2016 09:58:46 +0200 Message-ID: <87shw76ki1.fsf@amu.edu.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) On 2016-06-09, at 13:56, Marcin Borkowski wrote: > 2b. Write a few tests for `mark-defun',_then_ fix the problem, and chec= k > whether these tests pass. Of course, all these tests would be for Elis= p > (and maybe for C and/or JavaScript). Hi all, it seems nobody cared enough to answer my question, so I made the choice of doing the Right Thing=E2=84=A2, and started from developing some tests= for mark-defun. Here's what I've got now. --8<---------------cut here---------------start------------->8--- ;;; elisp-mode-tests.el --- Tests for emacs-lisp-mode -*- lexical-bindin= g: t; -*- ;; Copyright (C) 2015-2016 Free Software Foundation, Inc. ;; Author: Marcin Borkowski ;; Author: Dmitry Gutov ;; Author: Stephen Leake ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Code: (require 'ert) =0C ;;; Helpers ;; Copied and modified from `python-tests-with-temp-buffer' (defmacro elisp-tests-with-temp-buffer (contents &rest body) "Create a `emacs-lisp-mode' enabled temp buffer with CONTENTS. BODY is code to be executed within the temp buffer. Point is always located at the beginning of buffer." (declare (indent 1) (debug t)) `(with-temp-buffer (emacs-lisp-mode) (insert ,contents) (goto-char (point-min)) ,@body)) (defmacro conditional-save-excursion (arg &rest body) "Wrap BODY in `save-excursion', but only if ARG is non-nil."=20 (declare (indent 1) (debug t)) `(if ,arg (save-excursion ,@body) ,@body)) (defun look-at (string &optional count restore-point) "Move the point to the beginning of STRING in current buffer. Return the new point value. If COUNT is non-nil, move to COUNTth occurrence. If RESTORE-POINT is non-nil, return the found position, but do not move point." (conditional-save-excursion restore-point (setq count (or count 1)) (when (search-forward string nil t count) (goto-char (match-beginning 0))) (point))) =0C ;;; Mark (ert-deftest mark-defun-1 () "Test `mark-defun' with point inside the defun." (elisp-tests-with-temp-buffer " \(defun func-a () \"A parameterless function.\" (ignore)) ;; A comment right before a defun. \(defun func-b (argument) \"A function with one ARGUMENT.\" (ignore argument) (message \"%s\" \"Argument ignored.\")) \(defmacro macro-a (&rest body) \"A macro with BODY.\" `(,@body)) " (let ((expected-mark-beginning-position-1-2 (progn (look-at "(defun func-a ") (previous-line 1) (point))) (expected-mark-end-position-1 (save-excursion (look-at "(ignore))") (next-line 1) (point))) (expected-mark-end-position-2 (save-excursion (point) (look-at "\"))") (next-line 1) (point))) (expected-mark-beginning-position-3 (progn (look-at "(defmacro macro-a ") (previous-line 1) (point))) (expected-mark-end-position-3 (progn (look-at "(,@body)") (next-line 1) (point)))) ;; select the first defun (goto-char (point-min)) (look-at "A parameterless function.") (mark-defun) (should (=3D (point) expected-mark-beginning-position-1-2)) (should (=3D (marker-position (mark-marker)) expected-mark-end-position-1)) ;; expand to the second defun (mark-defun 1) (should (=3D (point) expected-mark-beginning-position-1-2)) (should (=3D (marker-position (mark-marker)) expected-mark-end-position-2)) ;; select the macro (look-at "A macro") (mark-defun) (should (=3D (point) expected-mark-beginning-position-3)) (should (=3D (marker-position (mark-marker)) expected-mark-end-position-3))))) (ert-deftest mark-defun-2 () "Test `mark-defun' with point between defuns." (elisp-tests-with-temp-buffer " \(defun func-a () \"A parameterless function.\" (ignore)) ;; A comment right before a defun. \(defun func-b (argument) \"A function with one ARGUMENT.\" (ignore argument) (message \"%s\" \"Argument ignored.\")) \(defmacro macro-a (&rest body) \"A macro with BODY.\" `(,@body)) " (let ((expected-mark-beginning-position-1 (progn (look-at "(defun func-b ") (point))) (expected-mark-end-position-1 (save-excursion (look-at "ignored.\"))") (next-line 1) (point)))) ;; select the first defun (goto-char expected-mark-end-position-1) (previous-line 1) (mark-defun) (should (=3D (point) expected-mark-beginning-position-1)) (should (=3D (marker-position (mark-marker)) expected-mark-end-position-1))))) (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here --8<---------------cut here---------------end--------------->8--- These two tests pass now. The next thing would be to change them to what /should/ pass. Before that, though, let me ask: what are your opinion on these simple tests? Are they enough? Would you add something? Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2016 09:02: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: To: 21072@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.146649970613390 (code B ref -1); Tue, 21 Jun 2016 09:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jun 2016 09:01:46 +0000 Received: from localhost ([127.0.0.1]:48543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFHYz-0003To-SH for submit@debbugs.gnu.org; Tue, 21 Jun 2016 05:01:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFHYx-0003TT-4P for submit@debbugs.gnu.org; Tue, 21 Jun 2016 05:01:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFHYn-0003w5-Ef for submit@debbugs.gnu.org; Tue, 21 Jun 2016 05:01:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFHYn-0003w1-Bj for submit@debbugs.gnu.org; Tue, 21 Jun 2016 05:01:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFHYh-0005x7-GI for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 05:01:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFHYd-0003uX-EA for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 05:01:23 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:63711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFHYd-0003uC-3D for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 05:01:19 -0400 Received: from [192.168.178.35] ([77.12.1.85]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0LgKx6-1blNFp2d8u-00ndZj for ; Tue, 21 Jun 2016 11:01:17 +0200 References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <83a8k2fjpi.fsf@gnu.org> <87y46kb11o.fsf@mbork.pl> <8737omh8yk.fsf@amu.edu.pl> <87shw76ki1.fsf@amu.edu.pl> From: Andreas =?UTF-8?Q?R=C3=B6hler?= Message-ID: <225dd67a-7980-ca40-bcbd-b4669b392c4a@easy-emacs.de> Date: Tue, 21 Jun 2016 11:05:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <87shw76ki1.fsf@amu.edu.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:hKkBMk4K4e/+Htqx33s/5k4ZrOxrP2VEAqYswarO48wcX/7PR9K x8TvKQ+i85d2hv2I5VUgme55miWDeVJYOxca5CYF37d5vIvvxOW4VSZ+Hkw7fUPNX9Y9upu kGkQHWMkiH7Es7kHavvjAmwVv86G+n1A5MD3SlAQo+tHwWhewS+HTpIpK/n6H1jlmu1Hv2a zVuruhuCpNWR8A360TT1w== X-UI-Out-Filterresults: notjunk:1;V01:K0:04n53ZZbyDM=:ZIvylHJ1P7DPAv2ePv8fBF bEPQ0YKW/h9PQLdhyZOh+hP6cFRhglf8FFZWfO1K4V8upz2mv4eEpRG4f6YKnRBYaH3wJq9rD QLVC/2ZYxbK1KAhAcm8H7tZFvwEiBkr4Bg3vPlP84Onw1M5dK31dCf/wZEUkmuIcuWXmAjBgT 3lCwxONPWG1zQiC886cA8DVggnQ7t0z4L4/Ub3brc6Ct4hYC/V0GnjNCMiBOgkzkY8C+2DZ0Q YWY+de5zC9JObfBco7nDmwONdpl1CLh1HCjS6cYlsfLaZQOWB/YAxZYuH6zx8JzTJP2exDo8R 92Z4ecwzNhwLPsWfSuE2yOSkJaGgKenJnIDyC+/NDRpghq19zodp+IpzYoH6anWtVmONE4mkG DOSpHzasRXXQYJqIJsbE0XT1X0B4CkmIEr65uOZBnGm/vsRvNNMfM80CERanF+cdzUryEMqXf f77sWdd+By1D5jI7rPj402rw5RMI1fnj9PFtUEHUvIkKaksvfY9KndPhlpUXzmYxemXHSJ6z8 YKzy/64zXXa52F0Q5osHPxMOrbORQ+8zDDy1iOPZPI5H37EgRiCVvClpLlRt1RTQ4JwqdGM8B tfSFRI0vw7PJ2plwyjt1hT8pUJsdbG4rMYRWIs12uSD7D5k5+pL8QIMtgc7oLQG46d7eMlYHM zivE9BApWw+JJINBJuHCCsR5rbvk5ty7slpMJLjrqeZUO4muSNbxX1B6zvcPIawO+XRZcdSRe 8/NqvNNtKPJnDenx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 21.06.2016 09:58, Marcin Borkowski wrote: > On 2016-06-09, at 13:56, Marcin Borkowski wrote: > >> 2b. Write a few tests for `mark-defun',_then_ fix the problem, and check >> whether these tests pass. Of course, all these tests would be for Elisp >> (and maybe for C and/or JavaScript). > Hi all, > > it seems nobody cared enough to answer my question, so I made the choice > of doing the Right Thing™, and started from developing some tests for > mark-defun. Here's what I've got now. > > --8<---------------cut here---------------start------------->8--- > ;;; elisp-mode-tests.el --- Tests for emacs-lisp-mode -*- lexical-binding: t; -*- > > ;; Copyright (C) 2015-2016 Free Software Foundation, Inc. > > ;; Author: Marcin Borkowski > ;; Author: Dmitry Gutov > ;; Author: Stephen Leake > > ;; This file is part of GNU Emacs. > > ;; GNU Emacs is free software: you can redistribute it and/or modify > ;; it under the terms of the GNU General Public License as published by > ;; the Free Software Foundation, either version 3 of the License, or > ;; (at your option) any later version. > > ;; GNU Emacs is distributed in the hope that it will be useful, > ;; but WITHOUT ANY WARRANTY; without even the implied warranty of > ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > ;; GNU General Public License for more details. > > ;; You should have received a copy of the GNU General Public License > ;; along with GNU Emacs. If not, see . > > ;;; Code: > > (require 'ert) > > > ;;; Helpers > > ;; Copied and modified from `python-tests-with-temp-buffer' > (defmacro elisp-tests-with-temp-buffer (contents &rest body) > "Create a `emacs-lisp-mode' enabled temp buffer with CONTENTS. > BODY is code to be executed within the temp buffer. Point is > always located at the beginning of buffer." > (declare (indent 1) (debug t)) > `(with-temp-buffer > (emacs-lisp-mode) > (insert ,contents) > (goto-char (point-min)) > ,@body)) > > (defmacro conditional-save-excursion (arg &rest body) > "Wrap BODY in `save-excursion', but only if ARG is non-nil." > (declare (indent 1) (debug t)) > `(if ,arg > (save-excursion ,@body) > ,@body)) > > (defun look-at (string &optional count restore-point) > "Move the point to the beginning of STRING in current buffer. > Return the new point value. If COUNT is non-nil, move to COUNTth > occurrence. If RESTORE-POINT is non-nil, return the found > position, but do not move point." > (conditional-save-excursion restore-point > (setq count (or count 1)) > (when (search-forward string nil t count) > (goto-char (match-beginning 0))) > (point))) > > > ;;; Mark > > (ert-deftest mark-defun-1 () > "Test `mark-defun' with point inside the defun." > (elisp-tests-with-temp-buffer > " > \(defun func-a () > \"A parameterless function.\" > (ignore)) > > ;; A comment right before a defun. > \(defun func-b (argument) > \"A function with one ARGUMENT.\" > (ignore argument) > (message \"%s\" \"Argument ignored.\")) > > \(defmacro macro-a (&rest body) > \"A macro with BODY.\" > `(,@body)) > " > (let ((expected-mark-beginning-position-1-2 > (progn > (look-at "(defun func-a ") > (previous-line 1) > (point))) > (expected-mark-end-position-1 > (save-excursion > (look-at "(ignore))") > (next-line 1) > (point))) > (expected-mark-end-position-2 > (save-excursion > (point) > (look-at "\"))") > (next-line 1) > (point))) > (expected-mark-beginning-position-3 > (progn > (look-at "(defmacro macro-a ") > (previous-line 1) > (point))) > (expected-mark-end-position-3 > (progn > (look-at "(,@body)") > (next-line 1) > (point)))) > ;; select the first defun > (goto-char (point-min)) > (look-at "A parameterless function.") > (mark-defun) > (should (= (point) expected-mark-beginning-position-1-2)) > (should (= (marker-position (mark-marker)) > expected-mark-end-position-1)) > ;; expand to the second defun > (mark-defun 1) > (should (= (point) expected-mark-beginning-position-1-2)) > (should (= (marker-position (mark-marker)) > expected-mark-end-position-2)) > ;; select the macro > (look-at "A macro") > (mark-defun) > (should (= (point) expected-mark-beginning-position-3)) > (should (= (marker-position (mark-marker)) > expected-mark-end-position-3))))) > > (ert-deftest mark-defun-2 () > "Test `mark-defun' with point between defuns." > (elisp-tests-with-temp-buffer > " > \(defun func-a () > \"A parameterless function.\" > (ignore)) > > ;; A comment right before a defun. > \(defun func-b (argument) > \"A function with one ARGUMENT.\" > (ignore argument) > (message \"%s\" \"Argument ignored.\")) > > \(defmacro macro-a (&rest body) > \"A macro with BODY.\" > `(,@body)) > " > (let ((expected-mark-beginning-position-1 > (progn > (look-at "(defun func-b ") > (point))) > (expected-mark-end-position-1 > (save-excursion > (look-at "ignored.\"))") > (next-line 1) > (point)))) > ;; select the first defun > (goto-char expected-mark-end-position-1) > (previous-line 1) > (mark-defun) > (should (= (point) expected-mark-beginning-position-1)) > (should (= (marker-position (mark-marker)) > expected-mark-end-position-1))))) > > (provide 'elisp-mode-tests) > ;;; elisp-mode-tests.el ends here > --8<---------------cut here---------------end--------------->8--- > > These two tests pass now. The next thing would be to change them to > what /should/ pass. Before that, though, let me ask: what are your > opinion on these simple tests? Are they enough? Would you add > something? > > Best, > Hi Marcin, should no one else respond for now: please come back after release. AFAIU the current implemention of beginning-of-defun prevents a consistent setup of related commands. A change here would include resp. require a major change... Don't give up :) Andreas From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2016 10:08:01 +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: To: Andreas =?UTF-8?Q?R=C3=B6hler?= Cc: 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.146650365319843 (code B ref 21072); Tue, 21 Jun 2016 10:08:01 +0000 Received: (at 21072) by debbugs.gnu.org; 21 Jun 2016 10:07:33 +0000 Received: from localhost ([127.0.0.1]:48580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFIae-00059w-F3 for submit@debbugs.gnu.org; Tue, 21 Jun 2016 06:07:33 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:45253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFIab-00059l-Ea for 21072@debbugs.gnu.org; Tue, 21 Jun 2016 06:07:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id D8ADDC3A102; Tue, 21 Jun 2016 12:07:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 OCZ3nD+1UaO8; Tue, 21 Jun 2016 12:07:20 +0200 (CEST) Received: from localhost (unknown [150.254.81.161]) by mail.mojserwer.eu (Postfix) with ESMTPSA id A42D4C3A0FF; Tue, 21 Jun 2016 12:07:20 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <83a8k2fjpi.fsf@gnu.org> <87y46kb11o.fsf@mbork.pl> <8737omh8yk.fsf@amu.edu.pl> <87shw76ki1.fsf@amu.edu.pl> <225dd67a-7980-ca40-bcbd-b4669b392c4a@easy-emacs.de> User-agent: mu4e 0.9.16; emacs 25.1.50.3 From: Marcin Borkowski In-reply-to: <225dd67a-7980-ca40-bcbd-b4669b392c4a@easy-emacs.de> Date: Tue, 21 Jun 2016 12:07:23 +0200 Message-ID: <87oa6u7t44.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 2016-06-21, at 11:05, Andreas Röhler wrote: > On 21.06.2016 09:58, Marcin Borkowski wrote: >> On 2016-06-09, at 13:56, Marcin Borkowski wrote: >> >>> 2b. Write a few tests for `mark-defun',_then_ fix the problem, and check >>> whether these tests pass. Of course, all these tests would be for Elisp >>> (and maybe for C and/or JavaScript). >> Hi all, >> >> it seems nobody cared enough to answer my question, so I made the choice >> of doing the Right Thing™, and started from developing some tests for >> mark-defun. Here's what I've got now. >> >> --8<---------------cut here---------------start------------->8--- >> ;;; elisp-mode-tests.el --- Tests for emacs-lisp-mode -*- lexical-binding: t; -*- >> >> ;; Copyright (C) 2015-2016 Free Software Foundation, Inc. >> >> ;; Author: Marcin Borkowski >> ;; Author: Dmitry Gutov >> ;; Author: Stephen Leake >> >> ;; This file is part of GNU Emacs. >> >> ;; GNU Emacs is free software: you can redistribute it and/or modify >> ;; it under the terms of the GNU General Public License as published by >> ;; the Free Software Foundation, either version 3 of the License, or >> ;; (at your option) any later version. >> >> ;; GNU Emacs is distributed in the hope that it will be useful, >> ;; but WITHOUT ANY WARRANTY; without even the implied warranty of >> ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> ;; GNU General Public License for more details. >> >> ;; You should have received a copy of the GNU General Public License >> ;; along with GNU Emacs. If not, see . >> >> ;;; Code: >> >> (require 'ert) >> >> >> ;;; Helpers >> >> ;; Copied and modified from `python-tests-with-temp-buffer' >> (defmacro elisp-tests-with-temp-buffer (contents &rest body) >> "Create a `emacs-lisp-mode' enabled temp buffer with CONTENTS. >> BODY is code to be executed within the temp buffer. Point is >> always located at the beginning of buffer." >> (declare (indent 1) (debug t)) >> `(with-temp-buffer >> (emacs-lisp-mode) >> (insert ,contents) >> (goto-char (point-min)) >> ,@body)) >> >> (defmacro conditional-save-excursion (arg &rest body) >> "Wrap BODY in `save-excursion', but only if ARG is non-nil." >> (declare (indent 1) (debug t)) >> `(if ,arg >> (save-excursion ,@body) >> ,@body)) >> >> (defun look-at (string &optional count restore-point) >> "Move the point to the beginning of STRING in current buffer. >> Return the new point value. If COUNT is non-nil, move to COUNTth >> occurrence. If RESTORE-POINT is non-nil, return the found >> position, but do not move point." >> (conditional-save-excursion restore-point >> (setq count (or count 1)) >> (when (search-forward string nil t count) >> (goto-char (match-beginning 0))) >> (point))) >> >> >> ;;; Mark >> >> (ert-deftest mark-defun-1 () >> "Test `mark-defun' with point inside the defun." >> (elisp-tests-with-temp-buffer >> " >> \(defun func-a () >> \"A parameterless function.\" >> (ignore)) >> >> ;; A comment right before a defun. >> \(defun func-b (argument) >> \"A function with one ARGUMENT.\" >> (ignore argument) >> (message \"%s\" \"Argument ignored.\")) >> >> \(defmacro macro-a (&rest body) >> \"A macro with BODY.\" >> `(,@body)) >> " >> (let ((expected-mark-beginning-position-1-2 >> (progn >> (look-at "(defun func-a ") >> (previous-line 1) >> (point))) >> (expected-mark-end-position-1 >> (save-excursion >> (look-at "(ignore))") >> (next-line 1) >> (point))) >> (expected-mark-end-position-2 >> (save-excursion >> (point) >> (look-at "\"))") >> (next-line 1) >> (point))) >> (expected-mark-beginning-position-3 >> (progn >> (look-at "(defmacro macro-a ") >> (previous-line 1) >> (point))) >> (expected-mark-end-position-3 >> (progn >> (look-at "(,@body)") >> (next-line 1) >> (point)))) >> ;; select the first defun >> (goto-char (point-min)) >> (look-at "A parameterless function.") >> (mark-defun) >> (should (= (point) expected-mark-beginning-position-1-2)) >> (should (= (marker-position (mark-marker)) >> expected-mark-end-position-1)) >> ;; expand to the second defun >> (mark-defun 1) >> (should (= (point) expected-mark-beginning-position-1-2)) >> (should (= (marker-position (mark-marker)) >> expected-mark-end-position-2)) >> ;; select the macro >> (look-at "A macro") >> (mark-defun) >> (should (= (point) expected-mark-beginning-position-3)) >> (should (= (marker-position (mark-marker)) >> expected-mark-end-position-3))))) >> >> (ert-deftest mark-defun-2 () >> "Test `mark-defun' with point between defuns." >> (elisp-tests-with-temp-buffer >> " >> \(defun func-a () >> \"A parameterless function.\" >> (ignore)) >> >> ;; A comment right before a defun. >> \(defun func-b (argument) >> \"A function with one ARGUMENT.\" >> (ignore argument) >> (message \"%s\" \"Argument ignored.\")) >> >> \(defmacro macro-a (&rest body) >> \"A macro with BODY.\" >> `(,@body)) >> " >> (let ((expected-mark-beginning-position-1 >> (progn >> (look-at "(defun func-b ") >> (point))) >> (expected-mark-end-position-1 >> (save-excursion >> (look-at "ignored.\"))") >> (next-line 1) >> (point)))) >> ;; select the first defun >> (goto-char expected-mark-end-position-1) >> (previous-line 1) >> (mark-defun) >> (should (= (point) expected-mark-beginning-position-1)) >> (should (= (marker-position (mark-marker)) >> expected-mark-end-position-1))))) >> >> (provide 'elisp-mode-tests) >> ;;; elisp-mode-tests.el ends here >> --8<---------------cut here---------------end--------------->8--- >> >> These two tests pass now. The next thing would be to change them to >> what /should/ pass. Before that, though, let me ask: what are your >> opinion on these simple tests? Are they enough? Would you add >> something? >> >> Best, >> > > Hi Marcin, > > should no one else respond for now: please come back after release. > AFAIU the current implemention of beginning-of-defun prevents a > consistent setup of related commands. A change here would include resp. > require a major change... OK, I see. > Don't give up :) I don't, I'm patient - I'm also working very slowly on this... > Andreas Thanks, best -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 12:32:01 +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: To: Drew Adams Cc: Eli Zaretskii , rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14761890981794 (code B ref 21072); Tue, 11 Oct 2016 12:32:01 +0000 Received: (at 21072) by debbugs.gnu.org; 11 Oct 2016 12:31:38 +0000 Received: from localhost ([127.0.0.1]:51812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btwDa-0000Sq-4n for submit@debbugs.gnu.org; Tue, 11 Oct 2016 08:31:38 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:58005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btwDX-0000Sg-So for 21072@debbugs.gnu.org; Tue, 11 Oct 2016 08:31:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9F2FCE6856; Tue, 11 Oct 2016 14:31:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 cX_rIMbiXA6h; Tue, 11 Oct 2016 14:31:29 +0200 (CEST) Received: from localhost (unknown [62.3.163.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 1B325E64AF; Tue, 11 Oct 2016 14:31:29 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.17; emacs 26.0.50.1 From: Marcin Borkowski In-reply-to: Date: Tue, 11 Oct 2016 14:31:38 +0200 Message-ID: <87bmyrvzh1.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-05-07, at 07:07, Drew Adams wrote: > I agree that the behavior is not particularly consistent, and it > does not completely correspond to the doc. What the best fix is, > I don't know. > > It's been this way for a long time, so there might be people > who expect or like it to do what it does, in which case the > doc should probably be fixed somewhat. > > On the other hand, I'd bet that few, if any, would complain if > better behavior were implemented. > > In any case, the behavior of being able to repeat to keep selecting > more defuns further down should be kept. > > I'd suggest that Someone (TM) (Marcin?) implement a better > behavior and propose it to emacs-devel. ;-) > > What might be better? > > 1. At least consistency wrt which defun gets selected, when > betweeen defuns. The doc suggests a general rule (the next > defun), but that is not always respected. > > 2. Something consistent also wrt a comment before the defun > that will be selected. > > 3. It could be good for a numeric prefix arg to select that > many defuns. > > 4. It could be good for a negative prefix arg to select in > the opposite direction. This is the main improvement I'd > like to see. E.g. `M-- C-M-h' selects the previous defun; > `M-2 C-M-h' selects the two previous defuns. > > Someone should play around and dream up something useful. > > Wrt #2, I'm not sure what the best approach might be. Hi all, it's been some time, and I implemented a better (?) behavior indeed. (Yes, I know a few months passed. But I don't have a lot of time to work on Emacs bugs now. This bug took me almost 8 hours over the past few months.) Basically, I took into consideration all the points Drew mentioned. I'd like to submit my work for review. I have one technical problem, though: I have it as a series of commits on a separate branch in my repo, and I'm not Git-literate enough to make one patch from them. Should I submit a series of patches? Should I rebase my commits into one big one? (No big deal, this might be a good idea anyway.) In the course of my work, I have also implemented a macro to help write tests for the new behavior (there are 6 ERT tests, with 40 assertions total). Here it is (for review): --8<---------------cut here---------------start------------->8--- (defvar elisp-test-point-marker-regex "=!\\([a-zA-Z0-9-]+\\)=" "A regexp matching placeholders for point position for `elisp-tests-with-temp-buffer'.") ;; Copied and heavily modified from `python-tests-with-temp-buffer' (defmacro elisp-tests-with-temp-buffer (contents &rest body) "Create a `emacs-lisp-mode' enabled temp buffer with CONTENTS. BODY is code to be executed within the temp buffer. Point is always located at the beginning of buffer. Special markers of the form =!NAME= in CONTENTS are removed, and a for each one a variable called NAME is bound to the position of such a marker." (declare (indent 1) (debug t)) `(with-temp-buffer (emacs-lisp-mode) (insert ,contents) (goto-char (point-min)) (while (re-search-forward elisp-test-point-marker-regex nil t) (delete-region (match-beginning 0) (match-end 0))) (goto-char (point-min)) ,(let (marker-list) (with-temp-buffer (insert (cond ((symbolp contents) (symbol-value contents)) (t contents))) (goto-char (point-min)) (while (re-search-forward elisp-test-point-marker-regex nil t) (push (list (intern (match-string-no-properties 1)) (match-beginning 0)) marker-list) (delete-region (match-beginning 0) (match-end 0)))) `(let ,marker-list ,@body)))) --8<---------------cut here---------------end--------------->8--- And it can be used like this: --8<---------------cut here---------------start------------->8--- (defvar mark-defun-test-buffer ";; Comment header =!before-1= \(defun func-1 (arg) =!inside-1=\"docstring\" body) =!after-1==!before-2= ;; Comment before a defun \(d=!inside-2=efun func-2 (arg) \"docstring\" body) =!after-2==!before-3= \(defun func-3 (arg) \"docstring\"=!inside-3= body) =!after-3==!before-4=(defun func-4 (arg) \"docstring\"=!inside-4= body) =!after-4= ;; end " "Test buffer for `mark-defun'.") (ert-deftest mark-defun-no-arg-region-inactive () "Test `mark-defun' with no prefix argument and inactive region." (elisp-tests-with-temp-buffer mark-defun-test-buffer ;; mark-defun inside a defun, with comments and an empty line ;; before (goto-char inside-1) (mark-defun) (should (= (point) before-1)) (should (= (mark) after-1)))) --8<---------------cut here---------------end--------------->8--- WDYT? -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 15:31:01 +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: To: Marcin Borkowski Cc: Eli Zaretskii , rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147619985918416 (code B ref 21072); Tue, 11 Oct 2016 15:31:01 +0000 Received: (at 21072) by debbugs.gnu.org; 11 Oct 2016 15:30:59 +0000 Received: from localhost ([127.0.0.1]:52312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btz19-0004my-5j for submit@debbugs.gnu.org; Tue, 11 Oct 2016 11:30:59 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:37043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btz17-0004ml-FF for 21072@debbugs.gnu.org; Tue, 11 Oct 2016 11:30:57 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9BFUoHR027364 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Oct 2016 15:30:51 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u9BFUoGq000878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Oct 2016 15:30:50 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u9BFUnGX012972; Tue, 11 Oct 2016 15:30:50 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 11 Oct 2016 08:30:47 -0700 (PDT) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <87bmyrvzh1.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > Basically, I took into consideration all the points Drew mentioned. I'd > like to submit my work for review. Thanks for working on this, Marcin. > I have one technical problem, > though: I have it as a series of commits on a separate branch in my > repo, and I'm not Git-literate enough to make one patch from them. Hopefully someone else can help with that. (For my part, if the code needed is small and you just include it here then I will give it a try and let you know what I think (FWIW).) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 17:08:01 +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: To: Drew Adams Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147620566327055 (code B ref 21072); Tue, 11 Oct 2016 17:08:01 +0000 Received: (at 21072) by debbugs.gnu.org; 11 Oct 2016 17:07:43 +0000 Received: from localhost ([127.0.0.1]:52377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0Wl-00072I-0Y for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:07:43 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:43236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu0Wi-000727-RE for 21072@debbugs.gnu.org; Tue, 11 Oct 2016 13:07:41 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 99300E6890; Tue, 11 Oct 2016 19:07:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 usx_NWSG4b-T; Tue, 11 Oct 2016 19:07:36 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id E7CD6E64AF; Tue, 11 Oct 2016 19:07:35 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.17; emacs 26.0.50.1 From: Marcin Borkowski In-reply-to: Date: Tue, 11 Oct 2016 19:07:47 +0200 Message-ID: <878ttux198.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-10-11, at 17:30, Drew Adams wrote: >> Basically, I took into consideration all the points Drew mentioned. I'd >> like to submit my work for review. > > Thanks for working on this, Marcin. You're welcome. BTW, as I probably already mentioned, while working on this, I found a bug in end-of-defun, and until it's fixed, I have to use a silly workaround. >> I have one technical problem, >> though: I have it as a series of commits on a separate branch in my >> repo, and I'm not Git-literate enough to make one patch from them. > > Hopefully someone else can help with that. I'd hope so! > (For my part, if the code needed is small and you just include it here > then I will give it a try and let you know what I think (FWIW).) Here's the code (sans tests): --8<---------------cut here---------------start------------->8--- (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" (save-excursion (forward-line 0) (unless (looking-at "^\\s-*$") (< (line-end-position) (let ((ppss (syntax-ppss))) (when (nth 4 ppss) (goto-char (nth 8 ppss))) (forward-comment (point-max)) (point)))))) (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (unless (bobp) (while (progn (forward-line -1) (in-comment-line-p))) (forward-line 1))) (defun mark-defun (&optional arg) "Put mark at end of this defun, point at beginning. The defun marked is the one that contains point or follows point. With positive ARG, mark this and that many next defuns. If (in Transient Mark mode) the mark is active, it marks the next defun after the one(s) already marked. With positive ARG, mark that many more defuns. With negative ARG, mark that many more previous defuns." (interactive "p") (setq arg (or arg 1)) (cond ((use-region-p) (if (>= arg 0) (set-mark (save-excursion (goto-char (mark)) ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed (dotimes (_ignore arg) (end-of-defun)) (point))) (beginning-of-defun-comments (- arg)))) (t (let ((opoint (point)) beg end) (push-mark opoint) ;; Try first in this order for the sake of languages with nested ;; functions where several can end at the same place as with the ;; offside rule, e.g. Python. (beginning-of-defun-comments) (setq beg (point)) (end-of-defun) (setq end (point)) (when (and (<= (point) opoint) (> arg 0)) ;; beginning-of-defun moved back one defun so we got the wrong ;; one. If ARG < 0, however, we actually want to go back. (goto-char opoint) (end-of-defun) (setq end (point)) (beginning-of-defun-comments) (setq beg (point))) (goto-char beg) (cond ((> arg 0) ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed (dotimes (_ignore arg) (end-of-defun)) (setq end (point)) (push-mark end nil t) (goto-char beg)) (t (goto-char beg) (beginning-of-defun (1- (- arg))) (push-mark end nil t)))))) (while (progn (forward-line -1) (looking-at "^\\s-*$"))) (forward-line 1)) --8<---------------cut here---------------end--------------->8--- Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 17:53:01 +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: To: 21072@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.147620835131291 (code B ref -1); Tue, 11 Oct 2016 17:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Oct 2016 17:52:31 +0000 Received: from localhost ([127.0.0.1]:52417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu1E6-00088d-TL for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:52:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu1E5-00088P-R0 for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:52:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bu1Dz-00027t-Ks for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:52:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_20,FREEMAIL_FROM, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu1Dz-00027m-Hl for submit@debbugs.gnu.org; Tue, 11 Oct 2016 13:52:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu1Dx-0005tp-83 for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 13:52:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bu1Dt-00025r-3w for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 13:52:20 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:59006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu1Ds-00025j-Pz for bug-gnu-emacs@gnu.org; Tue, 11 Oct 2016 13:52:17 -0400 Received: from [18.189.6.80] ([18.189.6.80]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0LrZ6L-1ar1Zi0RhN-013RGL for ; Tue, 11 Oct 2016 19:52:15 +0200 References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Message-ID: <63597cb2-4a43-56a0-a939-3cba9d17fc4a@gmail.com> Date: Tue, 11 Oct 2016 13:52:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <878ttux198.fsf@mbork.pl> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RTgpQixsVMmK5MUj2vcEL0xlwuBWK8LiP" X-Provags-ID: V03:K0:jZsg8bDaMeDs53xURKShrxFE90rVfZfoRG0MN/w/hK9p0oPYPsT R/hUzF4Tgzl4+KjH8eb8f+3DHdv9wj990k3CbNW6KC2/b8UyAMU8N5WvtNOw7s1YRytLV/f Z+rIZoetAULbeNRm9lBOesHuO4Pkglc8ZSTb+mZcLcuKJuH/lf+7uWrfC2RevuvRsjhUGB0 3Qo+b+eaAHhHjm6bTnLQQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:qR7Ocz3SD1k=:wLpiAGhaVvOUS1EeQeYySG WE2MRRIAXKzc0ZfAkMfI+vFoKc0BbmH3oH0TpKVNWuz2A1jIb/0lpLQy9bncihJ3fJF0VTZmZ 3DRpga8UqieNcwghHLiEGbkLnZ2cUHDqALBcQaxEi9YuSrOYZ+1HfhN+J71G9i9PEqLramfx/ VjW18k6ZMMwAN3KsCdKSCUB7U4Gymf3LwUkUdgcvydA+kSyKUcyP48235kZ9CJEw9F6U1AfUM YPnxIMy+A+cnfY8IF15kWl7SBhr1RlWRc48o3z3quStY9zfWvyUrV46z2f9Kw8WA0l6FuskTe TghJ+uN2Vxt/0aPdC1L6yGrvtrQF8LN9/+ZwnrZVbihKMx2dt3+sWcIugvZMHobF5oQEgiEnr z70L0temeHNurPFS7DSX/ZQDMEdfNPCynmWYG9oD61IKSevI+Rgj7KlIRqa6LQ9kI5d+F/ZPa 1uYEjjTFFl2GbxdI94y0DYasETukkK3QXHnmpJ1SA4kFLEsjxldt+18k8gqE+mz1nAowc4a4i EIuUbM/B+a61Ufh9vkt8iuWR9PWyFIdN/Fdrgmzie5SCt58c6uVeVFAaIdN3+3aYkKuAOD/Wv kOeP1Wxlxv/TF746Kk3iYmkARSCJ4XbAxue0D614kAxbIVR6+tFTznmY1z0G1uusVuJIqLSEm a0oKRFrbfpHRAteee2qkaY3H1Hjsrblea15Tq591rqHV5dmgS8A8KVuUsEktO0iDh770= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RTgpQixsVMmK5MUj2vcEL0xlwuBWK8LiP Content-Type: multipart/mixed; boundary="6X8VtQPEi7FLbCXf070oBWrgjmGMpQw25"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Message-ID: <63597cb2-4a43-56a0-a939-3cba9d17fc4a@gmail.com> Subject: Re: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <878ttux198.fsf@mbork.pl> --6X8VtQPEi7FLbCXf070oBWrgjmGMpQw25 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-10-11 13:07, Marcin Borkowski wrote: >>> >> I have one technical problem, >>> >> though: I have it as a series of commits on a separate branch in m= y >>> >> repo, and I'm not Git-literate enough to make one patch from them.= >> > >> > Hopefully someone else can help with that. > I'd hope so! Would http://stackoverflow.com/questions/616556/how-do-you-squash-commits= -into-one-patch-with-git-format-patch help? The top answer is the one I'= d recommend. Cheers, Cl=E9ment. --6X8VtQPEi7FLbCXf070oBWrgjmGMpQw25-- --RTgpQixsVMmK5MUj2vcEL0xlwuBWK8LiP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX/SbIAAoJEPqg+cTm90wjfc4QAJ6LJ1Od99fPIjI1daJwJq2/ qcmL5rnL4Ul8JaR3xQN4uxiRCN90s0p1SqSk53iEhydm72Gh/5T+gY4D1Yh45fmm HxLxPcdOLUSBVPHP+xBglBQw62klQYqRbMUx9vYJUc3XcDkm2a5jK6zsNN6qJ/y3 Yxf01HK48oBSPQ6JnDRijfvVMp6mpxiveotrhqqrZMjkNIIi/7rx5jxlVbs5/g/U biTkAKHWV5Onc/rmvdnpysF+SH6oK37LFNl0bJaAXboBl9r+QHecotE0EVs/6a8j JlaA6Rb9cpcpJPZ8Ru5U554n+LaiNgdkfsDfXdcstV8fSaz8FbFPbwhLoSUkWD5/ xkVobZHhCU0WRH3rnR91lVzzRSChJSJbqbxBeHpBV4YPWBKsCH8TGQoMtemzAdhg gKNjqM4Sbxm48HMrQhSWhtBwqFGwnm4KnF++/TzdQ5fSA09zxw2cDfLmJogsry4d vlBsQG0MODqkXuPu7bQynn5kRovjuTmRDxVy/X63Ij1CK1r4Zrs+/1UG9kX6CAE/ CPB2T60do4epkWSH9t2C9+XEFGA/vJLZVmGDv2fOolb/8/duGe0De7v09ammbIYz oNkLRqUQs6iXHFdewLR0brDM7vnTfWEGK678gkYPrgZDCPJE3y6ANCiLxG1FHO9m 0HUt7jd/cF7O1wek+unq =b8gS -----END PGP SIGNATURE----- --RTgpQixsVMmK5MUj2vcEL0xlwuBWK8LiP-- From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 20:28:01 +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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147621764112876 (code B ref 21072); Tue, 11 Oct 2016 20:28:01 +0000 Received: (at 21072) by debbugs.gnu.org; 11 Oct 2016 20:27:21 +0000 Received: from localhost ([127.0.0.1]:52480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu3dx-0003Lc-Hc for submit@debbugs.gnu.org; Tue, 11 Oct 2016 16:27:21 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:41521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu3dv-0003LO-2q for 21072@debbugs.gnu.org; Tue, 11 Oct 2016 16:27:19 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9BKRC4A016882 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Oct 2016 20:27:13 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u9BKRBNU021682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Oct 2016 20:27:12 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u9BKR0Mt017039; Tue, 11 Oct 2016 20:27:10 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 11 Oct 2016 13:26:59 -0700 (PDT) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <878ttux198.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) BTW, IMO this should be removed: "(in Transient Mark Mode)". (This is not really related to this bug, however.) Unless transient-mark-mode is enabled there is not even any notion of the mark being "active". That notion is valid only for t-m-m. It makes no sense to speak of an active mark or region, otherwise. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Oct 2016 21:16: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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147622055217502 (code B ref 21072); Tue, 11 Oct 2016 21:16:02 +0000 Received: (at 21072) by debbugs.gnu.org; 11 Oct 2016 21:15:52 +0000 Received: from localhost ([127.0.0.1]:52497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu4Ot-0004YE-VZ for submit@debbugs.gnu.org; Tue, 11 Oct 2016 17:15:52 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bu4Or-0004Xx-Uf for 21072@debbugs.gnu.org; Tue, 11 Oct 2016 17:15:50 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9BLFhtS008835 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Oct 2016 21:15:43 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u9BLFg8D019495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Oct 2016 21:15:43 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u9BLFeNI026155; Tue, 11 Oct 2016 21:15:41 GMT MIME-Version: 1.0 Message-ID: <366cfd22-c35c-4980-bc81-7f6df6c180a0@default> Date: Tue, 11 Oct 2016 14:15:39 -0700 (PDT) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <878ttux198.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 1. Respect of the optional arg even for non-interactive use is an improvement, I think. 2. And it seems that no code distributed with Emacs calls `mark-defun' with the optional arg. So no problem there. And it is unlikely that 3rd-party code would call with the arg and expect it to be ignored (as was the case before). 3. With this at the top of *scratch* (note the blank line at top) and point between the comment and the defun, each of `M-- C-M-h' and `C-M-h' seems to loop indefinitely. -------------8<---------------- ;; This buffer is for notes you don't want to save, and for Lisp evaluation= . ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun a () nil) -------------8<---------------- 4. And with the same thing, but without the blank line at the top, both `M-- C-M-h' and `C-M-h' select the defun plus the comment, except that they do not select the first comment line. Intended? 5. `M-- C-M-h' and `C-M-h' always seem to select blank lines before the defun. Should they (what for)? 6. Interactively, I would rather see repeated use of `C-M-h', after an initial use of `C-M-h' with a negative prefix arg (e.g. `M-- C-M-h'), continue to select defuns backward. IOW, not need to use `M--' explicitly for each `C-M-h'. You can just hold down `C-M-h', to select multiple defuns forward. I would like to be able to do the same thing, but backward, by using `M-- C-M-h C-M-h C-M-h C-M-h...' (just hold down the chord). If you do that, then a negative prefix arg should not mean backward; it should just mean change direction (backward if previous command was not `mark-defun'). 7. Someone will really need to test this with more than just Emacs Lisp. The comments talk about Python and nesting, etc. HTH. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Oct 2016 05:35:01 +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: To: Drew Adams Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147763289912396 (code B ref 21072); Fri, 28 Oct 2016 05:35:01 +0000 Received: (at 21072) by debbugs.gnu.org; 28 Oct 2016 05:34:59 +0000 Received: from localhost ([127.0.0.1]:33049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzzoh-0003Ds-0v for submit@debbugs.gnu.org; Fri, 28 Oct 2016 01:34:59 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:51803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzzof-0003Dk-Eb for 21072@debbugs.gnu.org; Fri, 28 Oct 2016 01:34:58 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 202D4E688C; Fri, 28 Oct 2016 07:34:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 ajIkYN206ETh; Fri, 28 Oct 2016 07:34:53 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 12D68E62CD; Fri, 28 Oct 2016 07:34:53 +0200 (CEST) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.17; emacs 26.0.50.1 From: Marcin Borkowski In-reply-to: <366cfd22-c35c-4980-bc81-7f6df6c180a0@default> Date: Fri, 28 Oct 2016 07:35:07 +0200 Message-ID: <87wpgtjat0.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-10-11, at 23:15, Drew Adams wrote: > 1. Respect of the optional arg even for non-interactive use is an > improvement, I think. Thanks. > 2. And it seems that no code distributed with Emacs calls `mark-defun' > with the optional arg. So no problem there. And it is unlikely > that 3rd-party code would call with the arg and expect it to be > ignored (as was the case before). I would guess so. > 3. With this at the top of *scratch* (note the blank line at top) > and point between the comment and the defun, each of `M-- C-M-h' > and `C-M-h' seems to loop indefinitely. > > -------------8<---------------- > > ;; This buffer is for notes you don't want to save, and for Lisp evaluation. > ;; If you want to create a file, visit that file with C-x C-f, > ;; then enter the text in that file's own buffer. > > (defun a () > nil) > -------------8<---------------- I'll investigate it, thanks for the report. > 4. And with the same thing, but without the blank line at the top, > both `M-- C-M-h' and `C-M-h' select the defun plus the comment, > except that they do not select the first comment line. Intended? No, see above. > 5. `M-- C-M-h' and `C-M-h' always seem to select blank lines before > the defun. Should they (what for)? I'm pretty sure that they should select blank lines either before or after the defun. I just chose the "before" way. > 6. Interactively, I would rather see repeated use of `C-M-h', after an > initial use of `C-M-h' with a negative prefix arg (e.g. `M-- C-M-h'), > continue to select defuns backward. IOW, not need to use `M--' > explicitly for each `C-M-h'. > > You can just hold down `C-M-h', to select multiple defuns forward. > I would like to be able to do the same thing, but backward, by > using `M-- C-M-h C-M-h C-M-h C-M-h...' (just hold down the chord). > > If you do that, then a negative prefix arg should not mean backward; > it should just mean change direction (backward if previous command > was not `mark-defun'). That's interesting. I'd like to implement it, but this will take time (apart from other things, I have a 10-days-old son now:-).) > 7. Someone will really need to test this with more than just Emacs Lisp. > The comments talk about Python and nesting, etc. Definitely. I do not feel competent enough for that, though. (I'm pretty sure I've seen some ERT stuff for testing that with Python, I'll check it.) > HTH. Yes, definitely - thanks a lot! Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Oct 2016 14:34: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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147766518411467 (code B ref 21072); Fri, 28 Oct 2016 14:34:02 +0000 Received: (at 21072) by debbugs.gnu.org; 28 Oct 2016 14:33:04 +0000 Received: from localhost ([127.0.0.1]:33744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c08DP-0002yt-Ul for submit@debbugs.gnu.org; Fri, 28 Oct 2016 10:33:04 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:19862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c08DO-0002yP-FV for 21072@debbugs.gnu.org; Fri, 28 Oct 2016 10:33:02 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9SEWutm021475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2016 14:32:56 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id u9SEWs7f025671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2016 14:32:54 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u9SEWpD3017587; Fri, 28 Oct 2016 14:32:53 GMT MIME-Version: 1.0 Message-ID: <84f0c05e-12cc-471a-972b-c67a1c7ba0cd@default> Date: Fri, 28 Oct 2016 07:32:49 -0700 (PDT) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> <87wpgtjat0.fsf@mbork.pl> In-Reply-To: <87wpgtjat0.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -3.7 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.7 (---) > > 5. `M-- C-M-h' and `C-M-h' always seem to select blank lines > > before the defun. Should they (what for)? >=20 > I'm pretty sure that they should select blank lines either before or > after the defun. I just chose the "before" way. Yes, that is consistent with, say `mark-paragraph'. > > 6. Interactively, I would rather see repeated use of `C-M-h', > > after an initial use of `C-M-h' with a negative prefix arg > > (e.g. `M-- C-M-h'), continue to select defuns backward. IOW, > > not need to use `M--' explicitly for each `C-M-h'. > > > > You can just hold down `C-M-h', to select multiple defuns > > forward. I would like to be able to do the same thing, but > > backward, by using `M-- C-M-h C-M-h C-M-h C-M-h...' (just > > hold down the chord). > > > > If you do that, then a negative prefix arg should not mean > > backward; it should just mean change direction (backward if > > previous command was not `mark-defun'). >=20 > That's interesting. I'd like to implement it, but this will take > time (apart from other things, I have a 10-days-old son now:-).) Thanks for considering it. And congratulations on young Borkowski! From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2016 07:29:01 +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: To: Drew Adams Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14780716975356 (code B ref 21072); Wed, 02 Nov 2016 07:29:01 +0000 Received: (at 21072) by debbugs.gnu.org; 2 Nov 2016 07:28:17 +0000 Received: from localhost ([127.0.0.1]:39714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1py4-0001OJ-TF for submit@debbugs.gnu.org; Wed, 02 Nov 2016 03:28:17 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:49543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1py3-0001OB-30 for 21072@debbugs.gnu.org; Wed, 02 Nov 2016 03:28:15 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B1C2721200B; Wed, 2 Nov 2016 08:28:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 fueBi8ZD9W-s; Wed, 2 Nov 2016 08:28:11 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 20AB4212009; Wed, 2 Nov 2016 08:28:11 +0100 (CET) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.17; emacs 26.0.50.3 From: Marcin Borkowski In-reply-to: <366cfd22-c35c-4980-bc81-7f6df6c180a0@default> Date: Wed, 02 Nov 2016 08:28:16 +0100 Message-ID: <87shra8hnz.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-10-11, at 23:15, Drew Adams wrote: > 3. With this at the top of *scratch* (note the blank line at top) > and point between the comment and the defun, each of `M-- C-M-h' > and `C-M-h' seems to loop indefinitely. > > -------------8<---------------- > > ;; This buffer is for notes you don't want to save, and for Lisp evaluation. > ;; If you want to create a file, visit that file with C-x C-f, > ;; then enter the text in that file's own buffer. > > (defun a () > nil) > -------------8<---------------- > > 4. And with the same thing, but without the blank line at the top, > both `M-- C-M-h' and `C-M-h' select the defun plus the comment, > except that they do not select the first comment line. Intended? Well, both these behaviors are manifestations of the same bug. Below is the corrected version. (And below that a question.) --8<---------------cut here---------------start------------->8--- (defun mark-defun (&optional arg) "Put mark at end of this defun, point at beginning. The defun marked is the one that contains point or follows point. With positive ARG, mark this and that many next defuns. If the mark is active, it marks the next defun after the one(s) already marked. With positive ARG, mark that many more defuns. With negative ARG, mark that many more previous defuns." (interactive "p") (setq arg (or arg 1)) (cond ((use-region-p) (if (>= arg 0) (set-mark (save-excursion (goto-char (mark)) ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed (dotimes (_ignore arg) (end-of-defun)) (point))) (beginning-of-defun-comments (- arg)))) (t (let ((opoint (point)) beg end) (push-mark opoint) ;; Try first in this order for the sake of languages with nested ;; functions where several can end at the same place as with the ;; offside rule, e.g. Python. (beginning-of-defun-comments) (setq beg (point)) (end-of-defun) (setq end (point)) (when (and (<= (point) opoint) (> arg 0)) ;; beginning-of-defun moved back one defun so we got the wrong ;; one. If ARG < 0, however, we actually want to go back. (goto-char opoint) (end-of-defun) (setq end (point)) (beginning-of-defun-comments) (setq beg (point))) (goto-char beg) (cond ((> arg 0) ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed (dotimes (_ignore arg) (end-of-defun)) (setq end (point)) (push-mark end nil t) (goto-char beg)) (t (goto-char beg) (beginning-of-defun (1- (- arg))) (push-mark end nil t)))))) (while (progn (forward-line -1) (and (looking-at "^\\s-*$") (not (bobp))))) (or (bobp) (forward-line 1))) --8<---------------cut here---------------end--------------->8--- > 6. Interactively, I would rather see repeated use of `C-M-h', after an > initial use of `C-M-h' with a negative prefix arg (e.g. `M-- C-M-h'), > continue to select defuns backward. IOW, not need to use `M--' > explicitly for each `C-M-h'. > > You can just hold down `C-M-h', to select multiple defuns forward. > I would like to be able to do the same thing, but backward, by > using `M-- C-M-h C-M-h C-M-h C-M-h...' (just hold down the chord). > > If you do that, then a negative prefix arg should not mean backward; > it should just mean change direction (backward if previous command > was not `mark-defun'). Just to be sure: you mean only the minus sign as argument, not a negative number? I'm also wondering whether to allow that for non-interactive use, too: I'm pretty sure nobody would want to call (mark-defun '-) from Lisp code, and it might make testing slightly easier. Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2016 18:26:01 +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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147811114420856 (code B ref 21072); Wed, 02 Nov 2016 18:26:01 +0000 Received: (at 21072) by debbugs.gnu.org; 2 Nov 2016 18:25:44 +0000 Received: from localhost ([127.0.0.1]:40864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c20EK-0005QK-Dx for submit@debbugs.gnu.org; Wed, 02 Nov 2016 14:25:44 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:45502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c20EI-0005Q4-Jf for 21072@debbugs.gnu.org; Wed, 02 Nov 2016 14:25:42 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA2IPa5O003538 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Nov 2016 18:25:36 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id uA2IPZl2015026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Nov 2016 18:25:35 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uA2IPOCT028244; Wed, 2 Nov 2016 18:25:27 GMT MIME-Version: 1.0 Message-ID: Date: Wed, 2 Nov 2016 11:25:20 -0700 (PDT) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <87shra8hnz.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Well, both these behaviors are manifestations of the same bug. > Below is the corrected version. (And below that a question.) The test cases I mentioned work now. Thx. I didn't try anything beyond those cases. Hopefully others will test a bit more. > > 6. Interactively, I would rather see repeated use of `C-M-h', > > after an initial use of `C-M-h' with a negative prefix arg=20 > > (e.g. `M-- C-M-h'), continue to select defuns backward. > > IOW, not need to use `M--' explicitly for each `C-M-h'. > > > > You can just hold down `C-M-h', to select multiple defuns > > forward. I would like to be able to do the same thing, > > but backward, by using `M-- C-M-h C-M-h C-M-h C-M-h...' > > (just hold down the chord). > > > > If you do that, then a negative prefix arg should not mean > > backward; it should just mean change direction (backward if > > previous command was not `mark-defun'). >=20 > Just to be sure: you mean only the minus sign as argument, not > a negative number? No, not really. But use your own judgment, I guess. This is the kind of behavior I had in mind. This is for `transpose-sexps', but it shows the behavior. _Any_ negative arg flips the direction. At the outset, a negative arg means move backward. The absolute value of ARG is the number of sexps to move over. (defun reversible-transpose-sexps (arg) "Reversible and repeatable `transpose-sexps'. Like `transpose-sexps', but: 1. Leaves point after the moved sexp. 2. When repeated, a negative prefix arg flips the direction." (interactive "p") (when (eq last-command 'rev-transp-sexps-back) (setq arg (- arg))) (transpose-sexps arg) (unless (natnump arg) (backward-sexp (abs arg)) (skip-syntax-backward " .") (setq this-command 'rev-transp-sexps-back))) (If you happen to try this with ARG=3D0, be aware that what you see is just the peculiar `transpose-sexps' behavior for ARG=3D0. This is not related to the code here.) > I'm also wondering whether to allow that for > non-interactive use, too: I'm pretty sure nobody would want to call > (mark-defun '-) from Lisp code, and it might make testing slightly > easier. I think the behavior should be the same. But see above. The arg passed should be numeric (positive, zero, or negative), IMO. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Nov 2016 07:49:01 +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: To: Drew Adams Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.147824568930812 (code B ref 21072); Fri, 04 Nov 2016 07:49:01 +0000 Received: (at 21072) by debbugs.gnu.org; 4 Nov 2016 07:48:09 +0000 Received: from localhost ([127.0.0.1]:42889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2ZEP-00080u-59 for submit@debbugs.gnu.org; Fri, 04 Nov 2016 03:48:09 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:34972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2ZEN-00080m-Pp for 21072@debbugs.gnu.org; Fri, 04 Nov 2016 03:48:08 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 828D0E64A4; Fri, 4 Nov 2016 08:48:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 0zz7o-PlNFsy; Fri, 4 Nov 2016 08:48:04 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 5007FE626F; Fri, 4 Nov 2016 08:48:04 +0100 (CET) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.17; emacs 26.0.50.3 From: Marcin Borkowski In-reply-to: Date: Fri, 04 Nov 2016 08:48:19 +0100 Message-ID: <87k2cj8z3w.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-10-28, at 16:32, Drew Adams wrote: > Thanks for considering it. And congratulations on young Borkowski! Thanks! On 2016-11-02, at 19:25, Drew Adams wrote: >> Well, both these behaviors are manifestations of the same bug. >> Below is the corrected version. (And below that a question.) > > The test cases I mentioned work now. Thx. I didn't try anything > beyond those cases. Hopefully others will test a bit more. I would hope so. > No, not really. But use your own judgment, I guess. I guess your version is simpler (no need to use raw prefix arg), and hence better. > This is the kind of behavior I had in mind. This is for > `transpose-sexps', but it shows the behavior. _Any_ negative > arg flips the direction. At the outset, a negative arg means > move backward. The absolute value of ARG is the number of > sexps to move over. > > (defun reversible-transpose-sexps (arg) > "Reversible and repeatable `transpose-sexps'. > Like `transpose-sexps', but: > 1. Leaves point after the moved sexp. > 2. When repeated, a negative prefix arg flips the direction." > (interactive "p") > (when (eq last-command 'rev-transp-sexps-back) (setq arg (- arg))) > (transpose-sexps arg) > (unless (natnump arg) > (backward-sexp (abs arg)) > (skip-syntax-backward " .") > (setq this-command 'rev-transp-sexps-back))) Very nice trick with the 'last-command, thanks! I included this in my code. I will also write some tests for that (it seems to work, but...) and send the code soon. >> I'm also wondering whether to allow that for >> non-interactive use, too: I'm pretty sure nobody would want to call >> (mark-defun '-) from Lisp code, and it might make testing slightly >> easier. > > I think the behavior should be the same. But see above. The > arg passed should be numeric (positive, zero, or negative), IMO. Again - I agree, this makes coding (though not necessarily testing!) simpler. Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2016 07:41:01 +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: To: Drew Adams Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148023241910127 (code B ref 21072); Sun, 27 Nov 2016 07:41:01 +0000 Received: (at 21072) by debbugs.gnu.org; 27 Nov 2016 07:40:19 +0000 Received: from localhost ([127.0.0.1]:42870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAu4R-0002dG-8w for submit@debbugs.gnu.org; Sun, 27 Nov 2016 02:40:19 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:34638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cAu4P-0002d7-Dm for 21072@debbugs.gnu.org; Sun, 27 Nov 2016 02:40:18 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B18BC1DA037; Sun, 27 Nov 2016 08:40:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 Zad5KLY2jmY9; Sun, 27 Nov 2016 08:40:12 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 6FF251DA02F; Sun, 27 Nov 2016 08:40:12 +0100 (CET) References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> User-agent: mu4e 0.9.17; emacs 26.0.50.3 From: Marcin Borkowski In-reply-to: <87k2cj8z3w.fsf@mbork.pl> Date: Sun, 27 Nov 2016 08:40:06 +0100 Message-ID: <87wpfppe09.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-11-04, at 08:48, Marcin Borkowski wrote: > Very nice trick with the 'last-command, thanks! I included this in my > code. I will also write some tests for that (it seems to work, but...) > and send the code soon. Hi Drew, hi all, so it turned out that my code only seemed to work. (The last-command trick was fine, but what I thought corrected the bob bug only introduced another one.) Here's the (yet another) version. (I'm not sharing my tests yet - I haven't yet written any tests covering the last-command trick.) I'd be very thankful for any feedback (although I will have even less time for Emacs bug work during the next two months - not only my son needs considerable time and effort, the same goes for my students;-).) --8<---------------cut here---------------start------------->8--- (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" (save-excursion (forward-line 0) (unless (looking-at "^\\s-*$") (< (line-end-position) (let ((ppss (syntax-ppss))) (when (nth 4 ppss) (goto-char (nth 8 ppss))) (forward-comment (point-max)) (point)))))) (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (let (nbobp) (while (progn (setq nbobp (zerop (forward-line -1))) (and (in-comment-line-p) nbobp))) (when nbobp (forward-line 1)))) (defun mark-defun (&optional arg) "Put mark at end of this defun, point at beginning. The defun marked is the one that contains point or follows point. With positive ARG, mark this and that many next defuns; with negative ARG, change the direction of marking. If the mark is active, it marks the next defun after the one(s) already marked. With positive ARG, mark that many more defuns. With negative ARG, mark that many more previous defuns." (interactive "p") (setq arg (or arg 1)) ;; Trick with 'mark-defun-back due to Drew Adams (when (eq last-command 'mark-defun-back) (setq arg (- arg))) (when (< arg 0) (setq this-command 'mark-defun-back)) (cond ((use-region-p) (if (>= arg 0) (set-mark (save-excursion (goto-char (mark)) ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed (dotimes (_ignore arg) (end-of-defun)) (point))) (beginning-of-defun-comments (- arg)))) (t (let ((opoint (point)) beg end) (push-mark opoint) ;; Try first in this order for the sake of languages with nested ;; functions where several can end at the same place as with the ;; offside rule, e.g. Python. (beginning-of-defun-comments) (setq beg (point)) (end-of-defun) (setq end (point)) (when (or (and (<= (point) opoint) (> arg 0)) (= beg (point-min))) ; we were before the first defun! ;; beginning-of-defun moved back one defun so we got the wrong ;; one. If ARG < 0, however, we actually want to go back. (goto-char opoint) (end-of-defun) (setq end (point)) (beginning-of-defun-comments) (setq beg (point))) (goto-char beg) (cond ((> arg 0) ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed (dotimes (_ignore arg) (end-of-defun)) (setq end (point)) (push-mark end nil t) (goto-char beg)) (t (goto-char beg) (beginning-of-defun (1- (- arg))) (push-mark end nil t)))))) (let (nbobp) (while (progn (setq nbobp (zerop (forward-line -1))) (and (looking-at "^\\s-*$") nbobp))) (when nbobp (forward-line 1)))) --8<---------------cut here---------------end--------------->8--- Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2016 18:52: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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148027269027847 (code B ref 21072); Sun, 27 Nov 2016 18:52:02 +0000 Received: (at 21072) by debbugs.gnu.org; 27 Nov 2016 18:51:30 +0000 Received: from localhost ([127.0.0.1]:43829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cB4Xy-0007F5-2T for submit@debbugs.gnu.org; Sun, 27 Nov 2016 13:51:30 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:18433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cB4Xw-0007Ep-0S for 21072@debbugs.gnu.org; Sun, 27 Nov 2016 13:51:28 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uARIpKmO025760 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 27 Nov 2016 18:51:21 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uARIpJWj026483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 27 Nov 2016 18:51:20 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uARIpG8Z003032; Sun, 27 Nov 2016 18:51:18 GMT MIME-Version: 1.0 Message-ID: <42ff21f5-3df8-4935-b30d-b13b6bcd5f85@default> Date: Sun, 27 Nov 2016 10:51:14 -0800 (PST) From: Drew Adams References: <55A74B3C.8030608@gmail.com> <87k2jm2bay.fsf@amu.edu.pl> <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> In-Reply-To: <87wpfppe09.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -5.2 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) 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. > 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 > ;; Trick with 'mark-defun-back due to Drew Adams No need for the attribution. ;-) 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) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp 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: To: Drew Adams Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148644853915755 (code B ref 21072); Tue, 07 Feb 2017 06:23:02 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Feb 2017 06:22:19 +0000 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 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 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 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) 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) 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> User-agent: mu4e 0.9.19; emacs 26.0.50.3 From: Marcin Borkowski In-reply-to: <42ff21f5-3df8-4935-b30d-b13b6bcd5f85@default> Date: Tue, 07 Feb 2017 07:22:51 +0100 Message-ID: <8737fqtt8k.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Feb 2017 16:16:01 +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: To: Marcin Borkowski Cc: rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148648410911801 (code B ref 21072); Tue, 07 Feb 2017 16:16:01 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Feb 2017 16:15:09 +0000 Received: from localhost ([127.0.0.1]:59174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb8Q9-00034H-E2 for submit@debbugs.gnu.org; Tue, 07 Feb 2017 11:15:09 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:51548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb8Q7-000343-NT for 21072@debbugs.gnu.org; Tue, 07 Feb 2017 11:15:08 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v17GF1Bf002643 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Feb 2017 16:15:02 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v17GF1aP005838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Feb 2017 16:15:01 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v17GEw6U004599; Tue, 7 Feb 2017 16:15:00 GMT MIME-Version: 1.0 Message-ID: <835c85d1-29bd-4397-8344-a9ec30cb2df6@default> Date: Tue, 7 Feb 2017 08:14:56 -0800 (PST) From: Drew Adams 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> <8737fqtt8k.fsf@mbork.pl> In-Reply-To: <8737fqtt8k.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > >> ;; Trick with 'mark-defun-back due to Drew Adams > > > > No need for the attribution. ;-) >=20 > Why not;-)? I'll change it to a link to your message, however - this > might be actually more useful for future developers. Yes, that's more useful; thx. > > 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) >=20 > 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? >=20 > 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? Yes, please pose the question for emacs-devel. And thanks for working on this bug. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 10:45: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: To: John Wiegley Cc: Emacs developers , 21072@debbugs.gnu.org, Dmitry Gutov Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148706909822188 (code B ref 21072); Tue, 14 Feb 2017 10:45:02 +0000 Received: (at 21072) by debbugs.gnu.org; 14 Feb 2017 10:44:58 +0000 Received: from localhost ([127.0.0.1]:39291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdabR-0005lo-96 for submit@debbugs.gnu.org; Tue, 14 Feb 2017 05:44:57 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:59761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdabP-0005lf-8C for 21072@debbugs.gnu.org; Tue, 14 Feb 2017 05:44:56 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id A6D9CE6A58; Tue, 14 Feb 2017 11:44:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 hIgelsw3K_mA; Tue, 14 Feb 2017 11:44:49 +0100 (CET) Received: from localhost (unknown [62.3.163.135]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 010E6E6A43; Tue, 14 Feb 2017 11:44:48 +0100 (CET) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> User-agent: mu4e 0.9.19; emacs 26.0.50.3 From: Marcin Borkowski In-reply-to: Date: Tue, 14 Feb 2017 11:45:29 +0100 Message-ID: <87wpctgieu.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain On 2017-02-13, at 20:00, John Wiegley wrote: >>>>>> Dmitry Gutov writes: > >> I'd rather interpret John as being entirely serious. :) Tests are good. > > Dmitry is quite right; any patch that comes with a battery of new tests is > already a huge plus in my book. Thanks - as I said, I was a bit unsure;-). Here's my proposed contribution, formatted as two patches. The first one introduces the testing machinery; the second one introduces mark-defun and its tests. WDYT? -- Marcin Borkowski --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-elisp-tests-with-temp-buffer-a-new-testing-macro.patch >From 0723e6a7c51bf3924e393e713f3509160d1782a6 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Tue, 14 Feb 2017 11:30:36 +0100 Subject: [PATCH] Add elisp-tests-with-temp-buffer, a new testing macro * test/lisp/progmodes/elisp-mode-tests.el (elisp-test-point-marker-regex) New variable. (elisp-tests-with-temp-buffer): New macro to help test functions moving the point and/or mark. --- test/lisp/progmodes/elisp-mode-tests.el | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index 93c428b2d2..a00f6b1b43 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -2,6 +2,7 @@ ;; Copyright (C) 2015-2017 Free Software Foundation, Inc. +;; Author: Marcin Borkowski ;; Author: Dmitry Gutov ;; Author: Stephen Leake @@ -672,5 +673,43 @@ xref-elisp-overloadable-separate-default (insert "?\\N{HEAVY CHECK MARK}") (should (equal (elisp--preceding-sexp) ?\N{HEAVY CHECK MARK})))) +;;; Helpers + +(defvar elisp-test-point-marker-regex "=!\\([a-zA-Z0-9-]+\\)=" + "A regexp matching placeholders for point position for +`elisp-tests-with-temp-buffer'.") + +;; Copied and heavily modified from `python-tests-with-temp-buffer' +(defmacro elisp-tests-with-temp-buffer (contents &rest body) + "Create an `emacs-lisp-mode' enabled temp buffer with CONTENTS. +BODY is the code to be executed within the temp buffer. Point is +always located at the beginning of buffer. Special markers of +the form =!NAME= in CONTENTS are removed, and a for each one +a variable called NAME is bound to the position of such +a marker." + (declare (indent 1) (debug t)) + `(with-temp-buffer + (emacs-lisp-mode) + (insert ,contents) + (goto-char (point-min)) + (while (re-search-forward elisp-test-point-marker-regex nil t) + (delete-region (match-beginning 0) + (match-end 0))) + (goto-char (point-min)) + ,(let (marker-list) + (with-temp-buffer + (insert (cond ((symbolp contents) + (symbol-value contents)) + (t contents))) + (goto-char (point-min)) + (while (re-search-forward elisp-test-point-marker-regex nil t) + (push (list (intern (match-string-no-properties 1)) + (match-beginning 0)) + marker-list) + (delete-region (match-beginning 0) + (match-end 0)))) + `(let ,marker-list + ,@body)))) + (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here -- 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Fix-bug-21072-and-rework-mark-defun.patch >From 962f0c653891a4faf2e8db638defbc8096f9d3f1 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Tue, 14 Feb 2017 11:37:08 +0100 Subject: [PATCH] Fix bug#21072 and rework `mark-defun' * test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer): New variable (mark-defun-no-arg-region-inactive) (mark-defun-no-arg-region-active) (mark-defun-arg-region-active) (mark-defun-pos-arg-region-inactive) (mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for the new `mark-defun' * lisp/emacs-lisp/lisp.el (in-comment-line-p): New function (beginning-of-defun-comments): New function (mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun' to accept a numerical prefix argument --- lisp/emacs-lisp/lisp.el | 130 ++++++++++++----- test/lisp/progmodes/elisp-mode-tests.el | 245 ++++++++++++++++++++++++++++++++ 2 files changed, 337 insertions(+), 38 deletions(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 0172e3af26..664691e629 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -398,6 +398,32 @@ beginning-of-defun-raw (goto-char (if arg-+ve floor ceiling)) nil)))))))) +(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 + (save-excursion + (forward-line 0) + (unless (looking-at "^\\s-*$") + (< (line-end-position) + (let ((ppss (syntax-ppss))) + (when (nth 4 ppss) + (goto-char (nth 8 ppss))) + (forward-comment (point-max)) + (point)))))) + +(defun beginning-of-defun-comments (&optional arg) + "Move to the beginning of ARGth defun, including comments." + (interactive "^p") + (unless arg (setq arg 1)) + (beginning-of-defun arg) + (let (nbobp) + (while (progn + (setq nbobp (zerop (forward-line -1))) + (and (in-comment-line-p) + nbobp))) + (when nbobp + (forward-line 1)))) + (defvar end-of-defun-function (lambda () (forward-sexp 1)) "Function for `end-of-defun' to call. @@ -478,48 +504,76 @@ end-of-defun (funcall end-of-defun-function) (funcall skip))))) -(defun mark-defun (&optional allow-extend) +(defun mark-defun (&optional arg) "Put mark at end of this defun, point at beginning. The defun marked is the one that contains point or follows point. +With positive ARG, mark this and that many next defuns; with negative +ARG, change the direction of marking. -Interactively, if this command is repeated -or (in Transient Mark mode) if the mark is active, -it marks the next defun after the ones already marked." +If the mark is active, it marks the next or previous defun(s) after +the one(s) already marked." (interactive "p") - (cond ((and allow-extend - (or (and (eq last-command this-command) (mark t)) - (and transient-mark-mode mark-active))) - (set-mark - (save-excursion - (goto-char (mark)) - (end-of-defun) - (point)))) - (t - (let ((opoint (point)) - beg end) - (push-mark opoint) - ;; Try first in this order for the sake of languages with nested - ;; functions where several can end at the same place as with - ;; the offside rule, e.g. Python. - (beginning-of-defun) - (setq beg (point)) - (end-of-defun) - (setq end (point)) - (while (looking-at "^\n") - (forward-line 1)) - (if (> (point) opoint) - (progn - ;; We got the right defun. - (push-mark beg nil t) - (goto-char end) - (exchange-point-and-mark)) - ;; beginning-of-defun moved back one defun - ;; so we got the wrong one. - (goto-char opoint) - (end-of-defun) - (push-mark (point) nil t) - (beginning-of-defun)) - (re-search-backward "^\n" (- (point) 1) t))))) + (setq arg (or arg 1)) + ;; There is no `mark-defun-back' function - see + ;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-11/msg00079.html + ;; for explanation + (when (eq last-command 'mark-defun-back) + (setq arg (- arg))) + (when (< arg 0) + (setq this-command 'mark-defun-back)) + (cond ((use-region-p) + (if (>= arg 0) + (set-mark + (save-excursion + (goto-char (mark)) + ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed + (dotimes (_ignore arg) + (end-of-defun)) + (point))) + (beginning-of-defun-comments (- arg)))) + (t + (let ((opoint (point)) + beg end) + (push-mark opoint) + ;; Try first in this order for the sake of languages with nested + ;; functions where several can end at the same place as with the + ;; offside rule, e.g. Python. + (beginning-of-defun-comments) + (setq beg (point)) + (end-of-defun) + (setq end (point)) + (when (or (and (<= (point) opoint) + (> arg 0)) + (= beg (point-min))) ; we were before the first defun! + ;; beginning-of-defun moved back one defun so we got the wrong + ;; one. If ARG < 0, however, we actually want to go back. + (goto-char opoint) + (end-of-defun) + (setq end (point)) + (beginning-of-defun-comments) + (setq beg (point))) + (goto-char beg) + (cond ((> arg 0) + ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed + (dotimes (_ignore arg) + (end-of-defun)) + (setq end (point)) + (push-mark end nil t) + (goto-char beg)) + (t + (goto-char beg) + (unless (= arg -1) ; beginning-of-defun behaves + ; strange with zero arg - see + ; https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-02/msg00196.html + (beginning-of-defun (1- (- arg)))) + (push-mark end nil t)))))) + (let (nbobp) + (while (progn + (setq nbobp (zerop (forward-line -1))) + (and (looking-at "^\\s-*$") + nbobp))) + (when nbobp + (forward-line 1)))) (defvar narrow-to-defun-include-comments nil "If non-nil, `narrow-to-defun' will also show comments preceding the defun.") diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index a00f6b1b43..2366e337df 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -711,5 +711,250 @@ elisp-tests-with-temp-buffer `(let ,marker-list ,@body)))) +;;; mark-defun + +(defvar mark-defun-test-buffer + ";; Comment header +=!before-1= +\(defun func-1 (arg) + =!inside-1=\"docstring\" + body) +=!after-1==!before-2= +;; Comment before a defun +\(d=!inside-2=efun func-2 (arg) + \"docstring\" + body) +=!after-2==!before-3= +\(defun func-3 (arg) + \"docstring\"=!inside-3= + body) +=!after-3==!before-4=(defun func-4 (arg) + \"docstring\"=!inside-4= + body) +=!after-4= +;; end +" + "Test buffer for `mark-defun'.") + +(ert-deftest mark-defun-no-arg-region-inactive () + "Test `mark-defun' with no prefix argument and inactive +region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun inside a defun, with comments and an empty line + ;; before + (goto-char inside-1) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun inside a defun with comments before + (deactivate-mark) + (goto-char inside-2) + (mark-defun) + (should (= (point) before-2)) + (should (= (mark) after-2)) + ;; mark-defun inside a defun with empty line before + (deactivate-mark) + (goto-char inside-3) + (mark-defun) + (should (= (point) before-3)) + (should (= (mark) after-3)) + ;; mark-defun inside a defun with another one right before + (deactivate-mark) + (goto-char inside-4) + (mark-defun) + (should (= (point) before-4)) + (should (= (mark) after-4)) + ;; mark-defun between a comment and a defun + (deactivate-mark) + (goto-char before-1) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun between defuns + (deactivate-mark) + (goto-char before-3) + (mark-defun) + (should (= (point) before-3)) + (should (= (mark) after-3)) + ;; mark-defun in comment right before the defun + (deactivate-mark) + (goto-char before-2) + (mark-defun) + (should (= (point) before-2)) + (should (= (mark) after-2)))) + +(ert-deftest mark-defun-no-arg-region-active () + "Test `mark-defun' with no prefix argument and active +region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun when a defun is marked + (goto-char before-1) + (set-mark after-1) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-2)) + ;; mark-defun when two defuns are marked + (deactivate-mark) + (goto-char before-1) + (set-mark after-2) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-3)))) + +(ert-deftest mark-defun-arg-region-active () + "Test `mark-defun' with a prefix arg and active region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun with positive arg when a defun is marked + (goto-char before-1) + (set-mark after-1) + (mark-defun 2) + (should (= (point) before-1)) + (should (= (mark) after-3)) + ;; mark-defun with arg=-1 when a defun is marked + (goto-char before-2) + (set-mark after-2) + (mark-defun -1) + (should (= (point) before-1)) + (should (= (mark) after-2)) + ;; mark-defun with arg=-2 when a defun is marked + (goto-char before-3) + (set-mark after-3) + (mark-defun -2) + (should (= (point) before-1)) + (should (= (mark) after-3)))) + +(ert-deftest mark-defun-pos-arg-region-inactive () + "Test `mark-defun' with positive argument and inactive + region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun with positive arg inside a defun + (goto-char inside-1) + (mark-defun 2) + (should (= (point) before-1)) + (should (= (mark) after-2)) + ;; mark-defun with positive arg between defuns + (deactivate-mark) + (goto-char before-3) + (mark-defun 2) + (should (= (point) before-3)) + (should (= (mark) after-4)) + ;; mark-defun with positive arg in a comment + (deactivate-mark) + (goto-char before-2) + (mark-defun 2) + (should (= (point) before-2)) + (should (= (mark) after-3)))) + +(ert-deftest mark-defun-neg-arg-region-inactive () + "Test `mark-defun' with negative argument and inactive + region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun with arg=-1 inside a defun + (goto-char inside-1) + (mark-defun -1) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun with arg=-1 between defuns + (deactivate-mark) + (goto-char after-2) + (mark-defun -1) + (should (= (point) before-2)) + (should (= (mark) after-2)) + ;; mark-defun with arg=-1 in a comment + ;; (this is probably not an optimal behavior...) + (deactivate-mark) + (goto-char before-2) + (mark-defun -1) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun with arg=-2 inside a defun + (deactivate-mark) + (goto-char inside-4) + (mark-defun -2) + (should (= (point) before-3)) + (should (= (mark) after-4)) + ;; mark-defun with arg=-2 between defuns + (deactivate-mark) + (goto-char before-3) + (mark-defun -2) + (should (= (point) before-1)) + (should (= (mark) after-2))) + (elisp-tests-with-temp-buffer ; test case submitted by Drew Adams + "(defun a () + nil) +=!before-b=(defun b () +=!in-b= nil) +=!after-b=;;;; +\(defun c () + nil) +" + (setq last-command nil) + (goto-char in-b) + (mark-defun -1) + (should (= (point) before-b)) + (should (= (mark) after-b)))) + +(ert-deftest mark-defun-bob () + "Test `mark-defun' at the beginning of buffer." + ;; Bob, comment, newline, defun + (setq last-command nil) + (elisp-tests-with-temp-buffer + ";; Comment at the bob +=!before= +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after))) + ;; Bob, newline, comment, defun + (elisp-tests-with-temp-buffer + "=!before= +;; Comment before the defun +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after))) + ;; Bob, comment, defun + (elisp-tests-with-temp-buffer + "=!before=;; Comment at the bob before the defun +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after))) + ;; Bob, newline, comment, newline, defun + (elisp-tests-with-temp-buffer + " +;; Comment before the defun +=!before= +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after)))) + (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here -- 2.11.0 --=-=-=-- From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 13:03: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: To: Marcin Borkowski , John Wiegley Cc: 21072@debbugs.gnu.org, Emacs developers Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14870773738913 (code B ref 21072); Tue, 14 Feb 2017 13:03:02 +0000 Received: (at 21072) by debbugs.gnu.org; 14 Feb 2017 13:02:53 +0000 Received: from localhost ([127.0.0.1]:39346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdckv-0002Jh-4z for submit@debbugs.gnu.org; Tue, 14 Feb 2017 08:02:53 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdckt-0002JS-Gd for 21072@debbugs.gnu.org; Tue, 14 Feb 2017 08:02:51 -0500 Received: by mail-wm0-f54.google.com with SMTP id v186so17227470wmd.0 for <21072@debbugs.gnu.org>; Tue, 14 Feb 2017 05:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=smpx9TyN0a1mLw8AZ9+moi9pJf93b/fvl6kZ1yrrTaw=; b=bmLI8d+ym2hFR82UMHpHNke4peyRVDuOpomy0ouRp8teE/zMnmLOpQ/8zKW9Fi6iue dAf2+rCOP6aJOMtGXT4r86D5geHZ5SPddNpeMdQ2zv6f2pXLFI27RrPiqlgIgP1KV6GM 9Lo72ewpi3vkJchEoR2C+tnmfz08560vPHBqRRTzkQUic4MkctFL7NVB1SnfMP4ZrfGi PeMVcn1H5f3cqoVem8OZE1FuUwB4hzldh03lvSxOkquFTEaSukRMwsmBKXW3LyWq4HXz shkcMETgpMPp3jaKl3VcchCDxcNEph/wDDyrWjQBIilV9LqHS1WdDcw6AkaNiFTYUTfC R95Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=smpx9TyN0a1mLw8AZ9+moi9pJf93b/fvl6kZ1yrrTaw=; b=TaZHFLcvBw7sJ+iI1xlVWWMKg6/LJQi4hnajY8SAPz2F8LY9qhoHaEWii2Prl4o6s0 DnvkgOLDYu5Il3neYWAFCQvMwTO4TOhUfzEh+l3vy022mWEtBg0v2DK+cxWJtNlih174 0asFMzLbYWkUs9fr4X6Di4ivmAwVc45Z0HmPq2Z1HmgmKTgkZQA2iuw/RliZ++W6JpZn I6KEbUsnQajTXocBlf8QKq9Ihcf+5/yca1002/Ey4Y0B2h64yN7TDHRMKQM5HZ+ocpkV CTOcO2vzPhiXKS9uxzBDmYfQIK1Fz9Z/tEyWwnjPZvUARUepes9yuiUk3zj+JQO7Oq23 BH7Q== X-Gm-Message-State: AMke39lwjzrax6RURUgADpPh5S5CDp38FEcoNjrFMD80sFHY/nwaENlscj/kcTLHUWH0Sw== X-Received: by 10.28.40.65 with SMTP id o62mr3262115wmo.131.1487077365853; Tue, 14 Feb 2017 05:02:45 -0800 (PST) Received: from [192.168.0.133] ([212.50.99.193]) by smtp.googlemail.com with ESMTPSA id x25sm735562wrx.27.2017.02.14.05.02.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2017 05:02:45 -0800 (PST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> From: Dmitry Gutov Message-ID: <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> Date: Tue, 14 Feb 2017 15:02:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <87wpctgieu.fsf@mbork.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 14.02.2017 12:45, Marcin Borkowski wrote: > +(defun in-comment-line-p () This needs a different name. Something like beginning-of-defun--in-comment-line-p might be a good choice. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 19:06:03 +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: To: Dmitry Gutov Cc: John Wiegley , 21072@debbugs.gnu.org, Emacs developers Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148709915522133 (code B ref 21072); Tue, 14 Feb 2017 19:06:03 +0000 Received: (at 21072) by debbugs.gnu.org; 14 Feb 2017 19:05:55 +0000 Received: from localhost ([127.0.0.1]:40115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdiQF-0005ku-K2 for submit@debbugs.gnu.org; Tue, 14 Feb 2017 14:05:55 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:56457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdiQD-0005kl-DY for 21072@debbugs.gnu.org; Tue, 14 Feb 2017 14:05:53 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 1C53DE6A6D; Tue, 14 Feb 2017 20:05:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 D7rzFLsxZLrL; Tue, 14 Feb 2017 20:05:48 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 1C273E6A39; Tue, 14 Feb 2017 20:05:47 +0100 (CET) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> User-agent: mu4e 0.9.19; emacs 26.0.50.3 From: Marcin Borkowski In-reply-to: <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> Date: Tue, 14 Feb 2017 20:06:24 +0100 Message-ID: <87tw7wh9sf.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-02-14, at 14:02, Dmitry Gutov wrote: > On 14.02.2017 12:45, Marcin Borkowski wrote: >> +(defun in-comment-line-p () > > This needs a different name. > > Something like beginning-of-defun--in-comment-line-p might be a good choice. Why? It seems to me that it may be of general use. Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2017 06:46: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: To: Stefan Monnier Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14871411031795 (code B ref 21072); Wed, 15 Feb 2017 06:46:02 +0000 Received: (at 21072) by debbugs.gnu.org; 15 Feb 2017 06:45:03 +0000 Received: from localhost ([127.0.0.1]:40439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdtKp-0000St-Dh for submit@debbugs.gnu.org; Wed, 15 Feb 2017 01:45:03 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:44298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdtKn-0000SD-IU for 21072@debbugs.gnu.org; Wed, 15 Feb 2017 01:45:02 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 3ADCFE6A73; Wed, 15 Feb 2017 07:45:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 VLWwAsbG6ebn; Wed, 15 Feb 2017 07:44:57 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 1807FE6A39; Wed, 15 Feb 2017 07:44:56 +0100 (CET) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> User-agent: mu4e 0.9.19; emacs 26.0.50.5 From: Marcin Borkowski In-reply-to: Date: Wed, 15 Feb 2017 07:45:37 +0100 Message-ID: <87k28sdka6.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-02-14, at 20:25, Stefan Monnier wrote: >> Why? It seems to me that it may be of general use. > > If you want it to be general, it'll have to be better defined. > What is a "comment line"? A line containing only a comment (possibly after whitespace). I guess the docstring could benefit from explaining this. Thanks, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2017 07:57:01 +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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14871453927907 (code B ref 21072); Wed, 15 Feb 2017 07:57:01 +0000 Received: (at 21072) by debbugs.gnu.org; 15 Feb 2017 07:56:32 +0000 Received: from localhost ([127.0.0.1]:40449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cduS0-00023T-BM for submit@debbugs.gnu.org; Wed, 15 Feb 2017 02:56:32 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:2031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cduRx-00023D-Vn for 21072@debbugs.gnu.org; Wed, 15 Feb 2017 02:56:30 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AxCwBOCKRY//7rSC1eGwEBAQMBAQEJAQEBg1JBhDSFVoVykR4pAZcYhhwEAgKCBEQUAQIBAQEBAQEBYiiEcQEEAVYjEAsOJhIUGA0kiXYIsgyLZgEBAQcCASWLPIo5BZBCizOTd4hNhlaTFjYhgQAgFAgqhx4iijwBAQE X-IPAS-Result: A0AxCwBOCKRY//7rSC1eGwEBAQMBAQEJAQEBg1JBhDSFVoVykR4pAZcYhhwEAgKCBEQUAQIBAQEBAQEBYiiEcQEEAVYjEAsOJhIUGA0kiXYIsgyLZgEBAQcCASWLPIo5BZBCizOTd4hNhlaTFjYhgQAgFAgqhx4iijwBAQE X-IronPort-AV: E=Sophos;i="5.35,165,1484024400"; d="scan'208";a="292926402" Received: from 45-72-235-254.cpe.teksavvy.com (HELO pastel.home) ([45.72.235.254]) by smtp.teksavvy.com with ESMTP; 15 Feb 2017 02:56:22 -0500 Received: by pastel.home (Postfix, from userid 20848) id BE4506591A; Wed, 15 Feb 2017 02:56:22 -0500 (EST) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> Date: Wed, 15 Feb 2017 02:56:22 -0500 In-Reply-To: <87k28sdka6.fsf@jane> (Marcin Borkowski's message of "Wed, 15 Feb 2017 07:45:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >>> Why? It seems to me that it may be of general use. >> If you want it to be general, it'll have to be better defined. >> What is a "comment line"? > A line containing only a comment (possibly after whitespace). Is a line (using C syntax) like: /* blablabla considered as a "comment line"? What about the likely next line: blablabla */ ? How about blablabla on a line between the previous two (i.e. within a comment)? Regardless of the answer you give above, I'm wondering in which kind of circumstance we'd want to test if we're on "a line containing only a comment". Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2017 19:18:01 +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: To: Stefan Monnier Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148718625623374 (code B ref 21072); Wed, 15 Feb 2017 19:18:01 +0000 Received: (at 21072) by debbugs.gnu.org; 15 Feb 2017 19:17:36 +0000 Received: from localhost ([127.0.0.1]:41342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce556-00064w-J3 for submit@debbugs.gnu.org; Wed, 15 Feb 2017 14:17:36 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:53064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce554-00064n-Qf for 21072@debbugs.gnu.org; Wed, 15 Feb 2017 14:17:35 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id E3F33E6A39; Wed, 15 Feb 2017 20:17:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 77zUnztwW1eC; Wed, 15 Feb 2017 20:17:29 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id F154AE6279; Wed, 15 Feb 2017 20:17:28 +0100 (CET) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50.5 From: Marcin Borkowski In-reply-to: Date: Wed, 15 Feb 2017 20:18:07 +0100 Message-ID: <87efyze00g.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-02-15, at 08:56, Stefan Monnier wrote: >>>> Why? It seems to me that it may be of general use. >>> If you want it to be general, it'll have to be better defined. >>> What is a "comment line"? >> A line containing only a comment (possibly after whitespace). > > Is a line (using C syntax) like: > > /* blablabla > > considered as a "comment line"? Yes. > What about the likely next line: > > blablabla */ Yes. > > ? > How about > > blablabla > > on a line between the previous two (i.e. within a comment)? Yes. (However, I found a minor bug: an empty line, even between a line "/*" and another with "*/" is _not_ considered a comment line by my function. I'll try to fix it. > Regardless of the answer you give above, I'm wondering in which kind of > circumstance we'd want to test if we're on "a line containing only > a comment". You will be surprised, then, that I actually did use a very similar function in completely another circumstance: a command that counts source lines of code in a region, and excludes lines containing only whitespace, comments and docstrings. (Never mind the discussion about whether SLOC is meaningful in any sense;-).) Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2017 19:28: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148718688124286 (code B ref 21072); Wed, 15 Feb 2017 19:28:02 +0000 Received: (at 21072) by debbugs.gnu.org; 15 Feb 2017 19:28:01 +0000 Received: from localhost ([127.0.0.1]:41354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce5FB-0006Je-3G for submit@debbugs.gnu.org; Wed, 15 Feb 2017 14:28:01 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce5F8-0006JT-8u for 21072@debbugs.gnu.org; Wed, 15 Feb 2017 14:27:59 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v1FJRtYm007044; Wed, 15 Feb 2017 14:27:56 -0500 Received: by pastel.home (Postfix, from userid 20848) id DCB0960594; Wed, 15 Feb 2017 14:27:55 -0500 (EST) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> <87efyze00g.fsf@jane> Date: Wed, 15 Feb 2017 14:27:55 -0500 In-Reply-To: <87efyze00g.fsf@jane> (Marcin Borkowski's message of "Wed, 15 Feb 2017 20:18:07 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5949=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5949> : inlines <5699> : streams <1733074> : uri <2377745> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> Regardless of the answer you give above, I'm wondering in which kind of >> circumstance we'd want to test if we're on "a line containing only >> a comment". > You will be surprised, then, that I actually did use a very similar > function in completely another circumstance: a command that counts > source lines of code in a region, and excludes lines containing only > whitespace, comments and docstrings. (Never mind the discussion about > whether SLOC is meaningful in any sense;-).) My point is that it's not very frequent to need this exact definition of a "comment line" and that there are various other possible definitions one might need in other circumstances. So at the very least, the doc should clarify which definition of "comment line" it uses. Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Feb 2017 04:41: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: To: Stefan Monnier Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148722000627695 (code B ref 21072); Thu, 16 Feb 2017 04:41:02 +0000 Received: (at 21072) by debbugs.gnu.org; 16 Feb 2017 04:40:06 +0000 Received: from localhost ([127.0.0.1]:41544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceDrS-0007Cd-FE for submit@debbugs.gnu.org; Wed, 15 Feb 2017 23:40:06 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:43916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceDrR-0007CV-0M for 21072@debbugs.gnu.org; Wed, 15 Feb 2017 23:40:05 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id BC827E6A67; Thu, 16 Feb 2017 05:40:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 fbzBSvj2cMjc; Thu, 16 Feb 2017 05:39:56 +0100 (CET) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3B8E0E6279; Thu, 16 Feb 2017 05:39:55 +0100 (CET) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> <87efyze00g.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50.5 From: Marcin Borkowski In-reply-to: Date: Thu, 16 Feb 2017 05:40:33 +0100 Message-ID: <87bmu2eoji.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-02-15, at 20:27, Stefan Monnier wrote: >>> Regardless of the answer you give above, I'm wondering in which kind of >>> circumstance we'd want to test if we're on "a line containing only >>> a comment". >> You will be surprised, then, that I actually did use a very similar >> function in completely another circumstance: a command that counts >> source lines of code in a region, and excludes lines containing only >> whitespace, comments and docstrings. (Never mind the discussion about >> whether SLOC is meaningful in any sense;-).) > > My point is that it's not very frequent to need this exact definition of > a "comment line" and that there are various other possible definitions > one might need in other circumstances. > So at the very least, the doc should clarify which definition of > "comment line" it uses. Understood. Do you have then any better idea for the name of this function? beginning-of-defun--incomment-line-p seems to specific, in-comment-line-p _may_ be indeed too general. (I'll make the docstring more precise, of course.) Thank you all for looking at the patch, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Feb 2017 13:23:01 +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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148725134829840 (code B ref 21072); Thu, 16 Feb 2017 13:23:01 +0000 Received: (at 21072) by debbugs.gnu.org; 16 Feb 2017 13:22:28 +0000 Received: from localhost ([127.0.0.1]:41781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceM0x-0007lE-OB for submit@debbugs.gnu.org; Thu, 16 Feb 2017 08:22:27 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:61818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceM0w-0007l0-2c for 21072@debbugs.gnu.org; Thu, 16 Feb 2017 08:22:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CnCQCjpqVY/56dpUVeGgEBAQECAQEBAQgBAQEBg1GEdYVWhXKRHikBlxWGHAQCAoIVRBQBAgEBAQEBAQFiKIRxAQQBViMFCwsOJhIUGA0kiXcIsl+LOwEBAQcCASWLO4o5BY9Gfos7k3oBiEyGVpFVgUM2IYEAIBQIKocfIopsAQEB X-IPAS-Result: A0CnCQCjpqVY/56dpUVeGgEBAQECAQEBAQgBAQEBg1GEdYVWhXKRHikBlxWGHAQCAoIVRBQBAgEBAQEBAQFiKIRxAQQBViMFCwsOJhIUGA0kiXcIsl+LOwEBAQcCASWLO4o5BY9Gfos7k3oBiEyGVpFVgUM2IYEAIBQIKocfIopsAQEB X-IronPort-AV: E=Sophos;i="5.35,169,1484024400"; d="scan'208";a="293051317" Received: from 69-165-157-158.dsl.teksavvy.com (HELO pastel.home) ([69.165.157.158]) by smtp.teksavvy.com with ESMTP; 16 Feb 2017 08:22:20 -0500 Received: by pastel.home (Postfix, from userid 20848) id 1F37765017; Thu, 16 Feb 2017 08:22:20 -0500 (EST) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> Date: Thu, 16 Feb 2017 08:22:20 -0500 In-Reply-To: <87bmu2eoji.fsf@jane> (Marcin Borkowski's message of "Thu, 16 Feb 2017 05:40:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Understood. Do you have then any better idea for the name of this > function? beginning-of-defun--incomment-line-p seems to specific, > in-comment-line-p _may_ be indeed too general. I'll let someone else decide if it deserves a "non-prefixed" name, but as for the name after the potential prefix, I think focusing on "comment" is the wrong idea. Maybe `insignificant-line-p`? Or `emptyish-line-p`? Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2017 08:55:03 +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: To: Stefan Monnier Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14873216666287 (code B ref 21072); Fri, 17 Feb 2017 08:55:03 +0000 Received: (at 21072) by debbugs.gnu.org; 17 Feb 2017 08:54:26 +0000 Received: from localhost ([127.0.0.1]:43026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceeJ7-0001dK-Qp for submit@debbugs.gnu.org; Fri, 17 Feb 2017 03:54:26 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:35283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ceeJ5-0001dB-Ho for 21072@debbugs.gnu.org; Fri, 17 Feb 2017 03:54:24 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B3C0DE6AA3; Fri, 17 Feb 2017 09:54:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 1BboqJRiXTKw; Fri, 17 Feb 2017 09:54:16 +0100 (CET) Received: from localhost (unknown [83.13.149.242]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 84D48E62C2; Fri, 17 Feb 2017 09:54:16 +0100 (CET) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50.5 From: Marcin Borkowski In-reply-to: Date: Fri, 17 Feb 2017 09:54:51 +0100 Message-ID: <87wpcpw61w.fsf@jane> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain On 2017-02-16, at 14:22, Stefan Monnier wrote: >> Understood. Do you have then any better idea for the name of this >> function? beginning-of-defun--incomment-line-p seems to specific, >> in-comment-line-p _may_ be indeed too general. > > I'll let someone else decide if it deserves a "non-prefixed" name, but > as for the name after the potential prefix, I think focusing on > "comment" is the wrong idea. Maybe `insignificant-line-p`? Or `emptyish-line-p`? OK, so I have renamed it and expanded the docstring. I attach a corrected patch (the second one, the first one is the same as before). Is there anything else I can do before we may apply this patch and consider bug#21072 fixed? (Notice that three places could be still corrected: two when bug#24427 is fixed and possibly another one when the strange behavior of (beginning-of-defun 0) is fixed - I will officially file a bug about it later. But these apparently will have to wait.) Best, -- Marcin Borkowski --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Fix-bug-21072-and-rework-mark-defun.patch >From 618217607d0bfc7ed8d4090afabea040088a0951 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Tue, 14 Feb 2017 11:37:08 +0100 Subject: [PATCH] Fix bug#21072 and rework `mark-defun' * test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer): New variable (mark-defun-no-arg-region-inactive) (mark-defun-no-arg-region-active) (mark-defun-arg-region-active) (mark-defun-pos-arg-region-inactive) (mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for the new `mark-defun' * lisp/emacs-lisp/lisp.el (in-emptyish-line-p): New function (beginning-of-defun-comments): New function (mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun' to accept a numerical prefix argument --- lisp/emacs-lisp/lisp.el | 132 ++++++++++++----- test/lisp/progmodes/elisp-mode-tests.el | 245 ++++++++++++++++++++++++++++++++ 2 files changed, 339 insertions(+), 38 deletions(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 0172e3af26..28b136eba4 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -398,6 +398,34 @@ beginning-of-defun-raw (goto-char (if arg-+ve floor ceiling)) nil)))))))) +(defun in-emptyish-line-p () + "Return non-nil if the point is in an \"emptyish\" line. +This means a line that consists entirely of comments and/or +whitespace." +;; See http://lists.gnu.org/archive/html/help-gnu-emacs/2016-08/msg00141.html + (save-excursion + (forward-line 0) + (< (line-end-position) + (let ((ppss (syntax-ppss))) + (when (nth 4 ppss) + (goto-char (nth 8 ppss))) + (forward-comment (point-max)) + (point))))) + +(defun beginning-of-defun-comments (&optional arg) + "Move to the beginning of ARGth defun, including comments." + (interactive "^p") + (unless arg (setq arg 1)) + (beginning-of-defun arg) + (let (nbobp) + (while (progn + (setq nbobp (zerop (forward-line -1))) + (and (not (looking-at "^\\s-*$")) + (in-emptyish-line-p) + nbobp))) + (when nbobp + (forward-line 1)))) + (defvar end-of-defun-function (lambda () (forward-sexp 1)) "Function for `end-of-defun' to call. @@ -478,48 +506,76 @@ end-of-defun (funcall end-of-defun-function) (funcall skip))))) -(defun mark-defun (&optional allow-extend) +(defun mark-defun (&optional arg) "Put mark at end of this defun, point at beginning. The defun marked is the one that contains point or follows point. +With positive ARG, mark this and that many next defuns; with negative +ARG, change the direction of marking. -Interactively, if this command is repeated -or (in Transient Mark mode) if the mark is active, -it marks the next defun after the ones already marked." +If the mark is active, it marks the next or previous defun(s) after +the one(s) already marked." (interactive "p") - (cond ((and allow-extend - (or (and (eq last-command this-command) (mark t)) - (and transient-mark-mode mark-active))) - (set-mark - (save-excursion - (goto-char (mark)) - (end-of-defun) - (point)))) - (t - (let ((opoint (point)) - beg end) - (push-mark opoint) - ;; Try first in this order for the sake of languages with nested - ;; functions where several can end at the same place as with - ;; the offside rule, e.g. Python. - (beginning-of-defun) - (setq beg (point)) - (end-of-defun) - (setq end (point)) - (while (looking-at "^\n") - (forward-line 1)) - (if (> (point) opoint) - (progn - ;; We got the right defun. - (push-mark beg nil t) - (goto-char end) - (exchange-point-and-mark)) - ;; beginning-of-defun moved back one defun - ;; so we got the wrong one. - (goto-char opoint) - (end-of-defun) - (push-mark (point) nil t) - (beginning-of-defun)) - (re-search-backward "^\n" (- (point) 1) t))))) + (setq arg (or arg 1)) + ;; There is no `mark-defun-back' function - see + ;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-11/msg00079.html + ;; for explanation + (when (eq last-command 'mark-defun-back) + (setq arg (- arg))) + (when (< arg 0) + (setq this-command 'mark-defun-back)) + (cond ((use-region-p) + (if (>= arg 0) + (set-mark + (save-excursion + (goto-char (mark)) + ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed + (dotimes (_ignore arg) + (end-of-defun)) + (point))) + (beginning-of-defun-comments (- arg)))) + (t + (let ((opoint (point)) + beg end) + (push-mark opoint) + ;; Try first in this order for the sake of languages with nested + ;; functions where several can end at the same place as with the + ;; offside rule, e.g. Python. + (beginning-of-defun-comments) + (setq beg (point)) + (end-of-defun) + (setq end (point)) + (when (or (and (<= (point) opoint) + (> arg 0)) + (= beg (point-min))) ; we were before the first defun! + ;; beginning-of-defun moved back one defun so we got the wrong + ;; one. If ARG < 0, however, we actually want to go back. + (goto-char opoint) + (end-of-defun) + (setq end (point)) + (beginning-of-defun-comments) + (setq beg (point))) + (goto-char beg) + (cond ((> arg 0) + ;; change the dotimes below to (end-of-defun arg) once bug #24427 is fixed + (dotimes (_ignore arg) + (end-of-defun)) + (setq end (point)) + (push-mark end nil t) + (goto-char beg)) + (t + (goto-char beg) + (unless (= arg -1) ; beginning-of-defun behaves + ; strange with zero arg - see + ; https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-02/msg00196.html + (beginning-of-defun (1- (- arg)))) + (push-mark end nil t)))))) + (let (nbobp) + (while (progn + (setq nbobp (zerop (forward-line -1))) + (and (looking-at "^\\s-*$") + nbobp))) + (when nbobp + (forward-line 1)))) (defvar narrow-to-defun-include-comments nil "If non-nil, `narrow-to-defun' will also show comments preceding the defun.") diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index a00f6b1b43..2366e337df 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -711,5 +711,250 @@ elisp-tests-with-temp-buffer `(let ,marker-list ,@body)))) +;;; mark-defun + +(defvar mark-defun-test-buffer + ";; Comment header +=!before-1= +\(defun func-1 (arg) + =!inside-1=\"docstring\" + body) +=!after-1==!before-2= +;; Comment before a defun +\(d=!inside-2=efun func-2 (arg) + \"docstring\" + body) +=!after-2==!before-3= +\(defun func-3 (arg) + \"docstring\"=!inside-3= + body) +=!after-3==!before-4=(defun func-4 (arg) + \"docstring\"=!inside-4= + body) +=!after-4= +;; end +" + "Test buffer for `mark-defun'.") + +(ert-deftest mark-defun-no-arg-region-inactive () + "Test `mark-defun' with no prefix argument and inactive +region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun inside a defun, with comments and an empty line + ;; before + (goto-char inside-1) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun inside a defun with comments before + (deactivate-mark) + (goto-char inside-2) + (mark-defun) + (should (= (point) before-2)) + (should (= (mark) after-2)) + ;; mark-defun inside a defun with empty line before + (deactivate-mark) + (goto-char inside-3) + (mark-defun) + (should (= (point) before-3)) + (should (= (mark) after-3)) + ;; mark-defun inside a defun with another one right before + (deactivate-mark) + (goto-char inside-4) + (mark-defun) + (should (= (point) before-4)) + (should (= (mark) after-4)) + ;; mark-defun between a comment and a defun + (deactivate-mark) + (goto-char before-1) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun between defuns + (deactivate-mark) + (goto-char before-3) + (mark-defun) + (should (= (point) before-3)) + (should (= (mark) after-3)) + ;; mark-defun in comment right before the defun + (deactivate-mark) + (goto-char before-2) + (mark-defun) + (should (= (point) before-2)) + (should (= (mark) after-2)))) + +(ert-deftest mark-defun-no-arg-region-active () + "Test `mark-defun' with no prefix argument and active +region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun when a defun is marked + (goto-char before-1) + (set-mark after-1) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-2)) + ;; mark-defun when two defuns are marked + (deactivate-mark) + (goto-char before-1) + (set-mark after-2) + (mark-defun) + (should (= (point) before-1)) + (should (= (mark) after-3)))) + +(ert-deftest mark-defun-arg-region-active () + "Test `mark-defun' with a prefix arg and active region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun with positive arg when a defun is marked + (goto-char before-1) + (set-mark after-1) + (mark-defun 2) + (should (= (point) before-1)) + (should (= (mark) after-3)) + ;; mark-defun with arg=-1 when a defun is marked + (goto-char before-2) + (set-mark after-2) + (mark-defun -1) + (should (= (point) before-1)) + (should (= (mark) after-2)) + ;; mark-defun with arg=-2 when a defun is marked + (goto-char before-3) + (set-mark after-3) + (mark-defun -2) + (should (= (point) before-1)) + (should (= (mark) after-3)))) + +(ert-deftest mark-defun-pos-arg-region-inactive () + "Test `mark-defun' with positive argument and inactive + region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun with positive arg inside a defun + (goto-char inside-1) + (mark-defun 2) + (should (= (point) before-1)) + (should (= (mark) after-2)) + ;; mark-defun with positive arg between defuns + (deactivate-mark) + (goto-char before-3) + (mark-defun 2) + (should (= (point) before-3)) + (should (= (mark) after-4)) + ;; mark-defun with positive arg in a comment + (deactivate-mark) + (goto-char before-2) + (mark-defun 2) + (should (= (point) before-2)) + (should (= (mark) after-3)))) + +(ert-deftest mark-defun-neg-arg-region-inactive () + "Test `mark-defun' with negative argument and inactive + region." + (setq last-command nil) + (elisp-tests-with-temp-buffer + mark-defun-test-buffer + ;; mark-defun with arg=-1 inside a defun + (goto-char inside-1) + (mark-defun -1) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun with arg=-1 between defuns + (deactivate-mark) + (goto-char after-2) + (mark-defun -1) + (should (= (point) before-2)) + (should (= (mark) after-2)) + ;; mark-defun with arg=-1 in a comment + ;; (this is probably not an optimal behavior...) + (deactivate-mark) + (goto-char before-2) + (mark-defun -1) + (should (= (point) before-1)) + (should (= (mark) after-1)) + ;; mark-defun with arg=-2 inside a defun + (deactivate-mark) + (goto-char inside-4) + (mark-defun -2) + (should (= (point) before-3)) + (should (= (mark) after-4)) + ;; mark-defun with arg=-2 between defuns + (deactivate-mark) + (goto-char before-3) + (mark-defun -2) + (should (= (point) before-1)) + (should (= (mark) after-2))) + (elisp-tests-with-temp-buffer ; test case submitted by Drew Adams + "(defun a () + nil) +=!before-b=(defun b () +=!in-b= nil) +=!after-b=;;;; +\(defun c () + nil) +" + (setq last-command nil) + (goto-char in-b) + (mark-defun -1) + (should (= (point) before-b)) + (should (= (mark) after-b)))) + +(ert-deftest mark-defun-bob () + "Test `mark-defun' at the beginning of buffer." + ;; Bob, comment, newline, defun + (setq last-command nil) + (elisp-tests-with-temp-buffer + ";; Comment at the bob +=!before= +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after))) + ;; Bob, newline, comment, defun + (elisp-tests-with-temp-buffer + "=!before= +;; Comment before the defun +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after))) + ;; Bob, comment, defun + (elisp-tests-with-temp-buffer + "=!before=;; Comment at the bob before the defun +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after))) + ;; Bob, newline, comment, newline, defun + (elisp-tests-with-temp-buffer + " +;; Comment before the defun +=!before= +\(defun func (arg)=!inside= + \"docstring\" + body) +=!after=" + (goto-char inside) + (mark-defun) + (should (= (point) before)) + (should (= (mark) after)))) + (provide 'elisp-mode-tests) ;;; elisp-mode-tests.el ends here -- 2.11.1 --=-=-=-- From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2017 16:47: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: To: Marcin Borkowski Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148890520521960 (code B ref 21072); Tue, 07 Mar 2017 16:47:02 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Mar 2017 16:46:45 +0000 Received: from localhost ([127.0.0.1]:44815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIG5-0005i8-3m for submit@debbugs.gnu.org; Tue, 07 Mar 2017 11:46:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIG3-0005hw-7x for 21072@debbugs.gnu.org; Tue, 07 Mar 2017 11:46:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clIFx-0004qd-5V for 21072@debbugs.gnu.org; Tue, 07 Mar 2017 11:46:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clIFs-0004k2-Mi; Tue, 07 Mar 2017 11:46:32 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4077 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1clIFr-0000CT-PF; Tue, 07 Mar 2017 11:46:32 -0500 Date: Tue, 07 Mar 2017 18:46:03 +0200 Message-Id: <83o9xdghmc.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87wpcpw61w.fsf@jane> (message from Marcin Borkowski on Fri, 17 Feb 2017 09:54:51 +0100) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Marcin Borkowski > Date: Fri, 17 Feb 2017 09:54:51 +0100 > Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org > > OK, so I have renamed it and expanded the docstring. I attach > a corrected patch (the second one, the first one is the same as before). > > Is there anything else I can do before we may apply this patch and > consider bug#21072 fixed? Thanks, this looks good, but please move the tests to lisp-tests.el, to keep our conventions wrt test names. Then this could go in. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2017 16:51: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: To: Marcin Borkowski , Stefan Monnier Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148890544522335 (code B ref 21072); Tue, 07 Mar 2017 16:51:02 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Mar 2017 16:50:45 +0000 Received: from localhost ([127.0.0.1]:44823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIJw-0005oB-QO for submit@debbugs.gnu.org; Tue, 07 Mar 2017 11:50:44 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:37013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clIJu-0005ny-Ol for 21072@debbugs.gnu.org; Tue, 07 Mar 2017 11:50:43 -0500 Received: by mail-wm0-f52.google.com with SMTP id n11so10112047wma.0 for <21072@debbugs.gnu.org>; Tue, 07 Mar 2017 08:50:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=f2IOz2awmRrJMA5TE2O7sumwU5XssEYptBAyoTbr7d8=; b=gdCOSW07KAyX+RG/VdCMiQt5H4U3ZODTMIk3g20WaMiRQgeB0sTrobXi+31eaXskns YvT/3vYk3NN2X21EQRnb67z98dvFP7nLgnT1sHWq02GyfaKDF+QNS42Q4pirv6rQCqk5 CLjWc++3cJs7cTMYpuriPhXjow6s4bbhvK61klcYdNQVne28CGWMNJ1FLB8JbmPs3jd3 iyYj8YYCTdq8P6xsY14K+oeGvtxeXcl3DCoLOFr0nS6Dr3ec+++y0Z7gcuEgLzMOm/5p eP9yO4CAwL+QmqFNc8qRXzLD8P51m5m8O5y63jkQQ4+l06NiI6XPR8seX6Ux+8z8qj3E rDKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f2IOz2awmRrJMA5TE2O7sumwU5XssEYptBAyoTbr7d8=; b=G0N6oopjyMyJKWsxmSpIwwf4ylGG9A/XRCLHT96VUyfurLeFhtVgoj0UbmLpzEcxdH gq1FvhpbvGDZaA1bb+BZEGaPCm9DAXG0skcSeVwVnirEhV0L1ZUDAmmSS/W8f8owEWDf vJgriPmsnqOtB71TA7nWtdiLzClX1rBAHhv3kg29TZEt82ILbUh30ITH8AR72SNuJMVe 67s0aV87Z9jCUv4YYqwi9dgMo+tLXQPDRTdtXmIDNl6nwkMgipsTEEdX8FY1+EmFzei1 QpX/zhxeAUlchr2ugIQCOnG5YuFRw0WZsYfVdrvpMh8ZQxHWZ5jA8ssKbmyx6JRXfPfI M4fw== X-Gm-Message-State: AMke39ldJDQ04qnz5PASp108hujOTwP1QsZFSyTuDfgVNm2LecQaBXE7UonB5WvsAnWM7Q== X-Received: by 10.28.234.206 with SMTP id g75mr1706505wmi.54.1488905436957; Tue, 07 Mar 2017 08:50:36 -0800 (PST) Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id d42sm682603wrd.37.2017.03.07.08.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Mar 2017 08:50:35 -0800 (PST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> From: Dmitry Gutov Message-ID: Date: Tue, 7 Mar 2017 18:50:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <87wpcpw61w.fsf@jane> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) On 17.02.2017 10:54, Marcin Borkowski wrote: > +(defun in-emptyish-line-p () In case you were wondering, I'm still not sure this is a valuable addition to our public API. But if Eli says it's okay, then it's probably okay. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2017 16:55:01 +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: To: Dmitry Gutov Cc: emacs-devel@gnu.org, mbork@mbork.pl, monnier@iro.umontreal.ca, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148890567822749 (code B ref 21072); Tue, 07 Mar 2017 16:55:01 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Mar 2017 16:54:38 +0000 Received: from localhost ([127.0.0.1]:44840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clINi-0005ur-9S for submit@debbugs.gnu.org; Tue, 07 Mar 2017 11:54:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clINg-0005ue-Lc for 21072@debbugs.gnu.org; Tue, 07 Mar 2017 11:54:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clINa-0004Pd-RP for 21072@debbugs.gnu.org; Tue, 07 Mar 2017 11:54:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clINW-0004Ob-Kl; Tue, 07 Mar 2017 11:54:26 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4087 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1clINV-0000zZ-Pg; Tue, 07 Mar 2017 11:54:26 -0500 Date: Tue, 07 Mar 2017 18:53:58 +0200 Message-Id: <83innlgh95.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Dmitry Gutov on Tue, 7 Mar 2017 18:50:33 +0200) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Dmitry Gutov > Date: Tue, 7 Mar 2017 18:50:33 +0200 > Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org > > On 17.02.2017 10:54, Marcin Borkowski wrote: > > +(defun in-emptyish-line-p () > > In case you were wondering, I'm still not sure this is a valuable > addition to our public API. > > But if Eli says it's okay, then it's probably okay. I don't really have an opinion, but perhaps it would be better to make it an internal function for now, indeed. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Mar 2017 06:31:01 +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: To: Dmitry Gutov Cc: emacs-devel@gnu.org, Stefan Monnier , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149076904820353 (code B ref 21072); Wed, 29 Mar 2017 06:31:01 +0000 Received: (at 21072) by debbugs.gnu.org; 29 Mar 2017 06:30:48 +0000 Received: from localhost ([127.0.0.1]:49989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct783-0005ID-S5 for submit@debbugs.gnu.org; Wed, 29 Mar 2017 02:30:48 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:55446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct782-0005I5-07 for 21072@debbugs.gnu.org; Wed, 29 Mar 2017 02:30:46 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9FD7FE69DB; Wed, 29 Mar 2017 08:30:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 y6TOXW9TE7tY; Wed, 29 Mar 2017 08:30:41 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id B0CD8E69D3; Wed, 29 Mar 2017 08:30:40 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Wed, 29 Mar 2017 08:30:41 +0200 Message-ID: <87r31goar2.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-03-07, at 17:50, Dmitry Gutov wrote: > On 17.02.2017 10:54, Marcin Borkowski wrote: >> +(defun in-emptyish-line-p () > > In case you were wondering, I'm still not sure this is a valuable > addition to our public API. Well, I renamed it anyway. Thanks, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Mar 2017 06:31: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: To: Eli Zaretskii Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org, monnier@iro.umontreal.ca, Dmitry Gutov Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149076905820379 (code B ref 21072); Wed, 29 Mar 2017 06:31:02 +0000 Received: (at 21072) by debbugs.gnu.org; 29 Mar 2017 06:30:58 +0000 Received: from localhost ([127.0.0.1]:49992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct78E-0005Ic-3y for submit@debbugs.gnu.org; Wed, 29 Mar 2017 02:30:58 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:55460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct78B-0005IU-Lz for 21072@debbugs.gnu.org; Wed, 29 Mar 2017 02:30:56 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id EB9D1E69DB; Wed, 29 Mar 2017 08:30:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 jtyg12rP_KNN; Wed, 29 Mar 2017 08:30:52 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 632B2E69D3; Wed, 29 Mar 2017 08:30:52 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> <83innlgh95.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <83innlgh95.fsf@gnu.org> Date: Wed, 29 Mar 2017 08:30:53 +0200 Message-ID: <87poh0oaqq.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-03-07, at 17:53, Eli Zaretskii wrote: >> From: Dmitry Gutov >> Date: Tue, 7 Mar 2017 18:50:33 +0200 >> Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org >> >> On 17.02.2017 10:54, Marcin Borkowski wrote: >> > +(defun in-emptyish-line-p () >> >> In case you were wondering, I'm still not sure this is a valuable >> addition to our public API. >> >> But if Eli says it's okay, then it's probably okay. > > I don't really have an opinion, but perhaps it would be better to make > it an internal function for now, indeed. Yep, that's what I did. -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Mar 2017 06:35:01 +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: To: Eli Zaretskii Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149076925120683 (code B ref 21072); Wed, 29 Mar 2017 06:35:01 +0000 Received: (at 21072) by debbugs.gnu.org; 29 Mar 2017 06:34:11 +0000 Received: from localhost ([127.0.0.1]:49998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct7BL-0005NX-LK for submit@debbugs.gnu.org; Wed, 29 Mar 2017 02:34:11 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:55557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ct7BK-0005NQ-DP for 21072@debbugs.gnu.org; Wed, 29 Mar 2017 02:34:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 65AC1E69D3; Wed, 29 Mar 2017 08:34:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 Gcbe4GnTvcuh; Wed, 29 Mar 2017 08:34:05 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 4258FE6819; Wed, 29 Mar 2017 08:34:05 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <83o9xdghmc.fsf@gnu.org> Date: Wed, 29 Mar 2017 08:34:06 +0200 Message-ID: <87o9wkoald.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-03-07, at 17:46, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Date: Fri, 17 Feb 2017 09:54:51 +0100 >> Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org >> >> OK, so I have renamed it and expanded the docstring. I attach >> a corrected patch (the second one, the first one is the same as before). >> >> Is there anything else I can do before we may apply this patch and >> consider bug#21072 fixed? > > Thanks, this looks good, but please move the tests to lisp-tests.el, > to keep our conventions wrt test names. > > Then this could go in. I just pushed it to a branch, forgetting about this email. I'll fix it and report back. For now, I deleted the branch I pushed; I'll pish it again as soon as I correct this. Thanks, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Mar 2017 11:19:01 +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: To: Eli Zaretskii Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149095913330737 (code B ref 21072); Fri, 31 Mar 2017 11:19:01 +0000 Received: (at 21072) by debbugs.gnu.org; 31 Mar 2017 11:18:53 +0000 Received: from localhost ([127.0.0.1]:53642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctuZx-0007zf-4g for submit@debbugs.gnu.org; Fri, 31 Mar 2017 07:18:53 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:50829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctuZv-0007zV-2h for 21072@debbugs.gnu.org; Fri, 31 Mar 2017 07:18:51 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id A0094E6B94; Fri, 31 Mar 2017 13:18:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 hb717LJs67BZ; Fri, 31 Mar 2017 13:18:44 +0200 (CEST) Received: from localhost (apn-37-248-138-17.dynamic.gprs.plus.pl [37.248.138.17]) by mail.mojserwer.eu (Postfix) with ESMTPSA id A0BC4E6B93; Fri, 31 Mar 2017 13:18:43 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <87o9wkoald.fsf@jane> Date: Fri, 31 Mar 2017 13:18:25 +0200 Message-ID: <87a881ofsu.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-03-29, at 08:34, Marcin Borkowski wrote: > On 2017-03-07, at 17:46, Eli Zaretskii wrote: > >>> From: Marcin Borkowski >>> Date: Fri, 17 Feb 2017 09:54:51 +0100 >>> Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org >>> >>> OK, so I have renamed it and expanded the docstring. I attach >>> a corrected patch (the second one, the first one is the same as before). >>> >>> Is there anything else I can do before we may apply this patch and >>> consider bug#21072 fixed? >> >> Thanks, this looks good, but please move the tests to lisp-tests.el, >> to keep our conventions wrt test names. >> >> Then this could go in. > > I just pushed it to a branch, forgetting about this email. I'll fix it > and report back. For now, I deleted the branch I pushed; I'll pish it > again as soon as I correct this. OK, I pushed the branch "fix-bug-21072". Can anyone confirm that it's ok and either merge it into master or tell me that I can do it? Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Apr 2017 20:23:01 +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: To: Marcin Borkowski Cc: Eli Zaretskii , 21072@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149116455620832 (code B ref 21072); Sun, 02 Apr 2017 20:23:01 +0000 Received: (at 21072) by debbugs.gnu.org; 2 Apr 2017 20:22:36 +0000 Received: from localhost ([127.0.0.1]:57788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cum1E-0005Pv-HX for submit@debbugs.gnu.org; Sun, 02 Apr 2017 16:22:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cum1D-0005Pj-G0 for 21072@debbugs.gnu.org; Sun, 02 Apr 2017 16:22:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cum17-0002Lo-OD for 21072@debbugs.gnu.org; Sun, 02 Apr 2017 16:22:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cum0t-0002CI-1B; Sun, 02 Apr 2017 16:22:15 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cum0q-0004ie-Ls; Sun, 02 Apr 2017 16:22:12 -0400 From: Glenn Morris References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> X-Spook: Vaccine infowar Transportation security Southwest X-Ran: ^5zo0u(]O%]<~pUp2&":*JViEetZ`,"x}(HEZ|o+!fQ|}eyBr_92H*om%EhJ)kjHX\ X-Hue: brightblack X-Attribution: GM Date: Sun, 02 Apr 2017 16:22:12 -0400 In-Reply-To: <87a881ofsu.fsf@jane> (Marcin Borkowski's message of "Fri, 31 Mar 2017 13:18:25 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Marcin Borkowski wrote: > OK, I pushed the branch "fix-bug-21072". Can anyone confirm that it's > ok and either merge it into master or tell me that I can do it? Nitpick: branch should have been called fix/bug-21072 (given lack of response to http://debbugs.gnu.org/25610, I can't blame you) While I'm nitpicking, please don't cc emacs-devel on bug reports. :) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Apr 2017 22:56: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: To: Marcin Borkowski Cc: Eli Zaretskii , 21072@debbugs.gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14911737329202 (code B ref 21072); Sun, 02 Apr 2017 22:56:02 +0000 Received: (at 21072) by debbugs.gnu.org; 2 Apr 2017 22:55:32 +0000 Received: from localhost ([127.0.0.1]:57873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuoPD-0002OM-Q1 for submit@debbugs.gnu.org; Sun, 02 Apr 2017 18:55:31 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:34085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuoPC-0002O8-TE for 21072@debbugs.gnu.org; Sun, 02 Apr 2017 18:55:31 -0400 Received: by mail-io0-f178.google.com with SMTP id b140so65682361iof.1 for <21072@debbugs.gnu.org>; Sun, 02 Apr 2017 15:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=YbfKk3uaZWCTN9uLgKhXYCI64qZq8o9DlmffiKBBYo0=; b=BMRI7yLSeEBaEyYTJx4+urqKx6XPun+dLHj9NkYYGiHyPTEa9gh8dopGFoH5LcHnSt ixfKLQIcbgb5D5oP+XsQgw12B03loTkWTac/eA98yrXbHNgMeMoczEUNBptyukfmGCed OsMQHwsIisaowoHfgVuT8jMHAQV0vzSD+8zu+b1JheCDgHii88j5oRbQCWplUaehnwgr faN7rs0ABwYfUW0PZUFZ73391J955sMW9Iyv0HEjHwK/g4oL44Utt/KPioWALi2edi4Z f5SRpL9OyunOSMd35IS3/5THzIwdPPXxvuJmtrmbb1Ouvp/jtd/FEBJ+/KMnDPlluWbF JDSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=YbfKk3uaZWCTN9uLgKhXYCI64qZq8o9DlmffiKBBYo0=; b=VbvhjT7dWWIutpXuoVl9RZjzz2hJGYziRvj3MIbldz3aShkzPFbu0aQs9+f4T0AO0g N7Ot/DlmDIMxejg5Zt2r4Ir2L164UR5W9MBh4pZXvMITDBcoiPZSmXsGLs4M4jKG8dLL +driKXfODGAKQ04axoJ1A+q6SmC6c5r2BOaky7tEkSH26pvDCWOEx2st0M9TqOJNimue 2kzbeD3k/2dh81j+s7SDT58FYsqIbRdLkwbud3W1P3U0EcTQrd4l0m5nJNQ02caNWMSZ xiAd8wQ1CosE2lhtU+frq1GCxEXhTkU0eInObIflJXpz/ofWBP6LMwca6f+MTe640lNu QBhg== X-Gm-Message-State: AFeK/H2jSmMdk3sKjmo1PJ0G1vtGYeM8YGHR0qTpImA8/+X4aXnwXfeOVfWXl0QNROZ5Xg== X-Received: by 10.107.165.212 with SMTP id o203mr13663877ioe.129.1491173725271; Sun, 02 Apr 2017 15:55:25 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b25sm6823886iod.32.2017.04.02.15.55.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Apr 2017 15:55:24 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> Date: Sun, 02 Apr 2017 18:56:46 -0400 In-Reply-To: <87a881ofsu.fsf@jane> (Marcin Borkowski's message of "Fri, 31 Mar 2017 13:18:25 +0200") Message-ID: <87k272wh8x.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Marcin Borkowski writes: > > OK, I pushed the branch "fix-bug-21072". Can anyone confirm that it's > ok and either merge it into master or tell me that I can do it? > > +** New macro 'elisp-tests-with-temp-buffer' > +which helps writing tests for functions that should change buffers in > +specific ways or manipulate point or mark positions. > + > +--- I don't this should be documented in NEWS since the macro is being added to a test file, so it's not part of Emacs' libraries. Also, the format of the NEWS entry is wrong in the same way as the next one (see below). > +With a prefix argument, it marks that many defuns or extends the > +region by the appropriate number of defuns. With negative prefix > +argument it marks defuns in the opposite direction and also changes > +the direction of selecting for subsequent uses of @code{mark-defun}. This doesn't say what exactly happens with zero as argument. The code seems to do something odd. Perhaps it should just be a user-error instead? Or maybe just a nop. > modified etc/NEWS > @@ -363,6 +363,15 @@ words where first character is upper rather than tit= le case, e.g., > "=C7=84ungla" instead of "=C7=85ungla". >=20=20 > > +** New behavior of 'mark-defun' implemented > +Prefix argument selects that many (or that many more) defuns. > +Negative prefix arg flips the direction of selection. Also, > +'mark-defun' between defuns correctly selects N following defuns (or > +-N previous for negative arguments). Finally, comments preceding the > +defun are selected unless they are separated from the defun by a blank > +line. > + > ++++ > * Changes in Specialized Modes and Packages in Emacs 26.1 >=20 This entry should go before the page separator, and the "+++" should go on the line just above the entry, not after it. > +(defun beginning-of-defun-comments (&optional arg) > + (let (nbobp) > + (while (progn > + (setq nbobp (zerop (forward-line -1))) > + (and (not (looking-at "^\\s-*$")) > + (beginning-of-defun--in-emptyish-line-p) > + nbobp))) > + (when nbobp > + (forward-line 1)))) The looking-at call is redundant, right? Anyway, can't that all be replaced by just (forward-comment (- (point))) (unless (bolp) (forward-line 1)) > +(defun mark-defun (&optional arg) > + (let (nbobp) > + (while (progn > + (setq nbobp (zerop (forward-line -1))) > + (and (looking-at "^\\s-*$") > + nbobp))) > + (when nbobp > + (forward-line 1)))) I think this can be just (skip-chars-backward "[:space:]\n") (unless (bolp) (forward-line 1)) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Apr 2017 08:25: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: To: npostavs@users.sourceforge.net Cc: 21072@debbugs.gnu.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149155349225643 (code B ref 21072); Fri, 07 Apr 2017 08:25:02 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Apr 2017 08:24:52 +0000 Received: from localhost ([127.0.0.1]:35704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwPCN-0006fX-P3 for submit@debbugs.gnu.org; Fri, 07 Apr 2017 04:24:51 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:49473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwPCL-0006fM-AF for 21072@debbugs.gnu.org; Fri, 07 Apr 2017 04:24:50 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 29303E6BE5; Fri, 7 Apr 2017 10:24:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 Hgg02NIDBpfc; Fri, 7 Apr 2017 10:24:42 +0200 (CEST) Received: from localhost (apn-37-248-138-13.dynamic.gprs.plus.pl [37.248.138.13]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 4809CE6BD6; Fri, 7 Apr 2017 10:24:40 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <87k272wh8x.fsf@users.sourceforge.net> Date: Fri, 07 Apr 2017 10:25:08 +0200 Message-ID: <871st4aal7.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hey, and thanks for your feedback! My answers to particular points are below. On 2017-04-03, at 00:56, npostavs@users.sourceforge.net wrote: > Marcin Borkowski writes: > >> >> OK, I pushed the branch "fix-bug-21072". Can anyone confirm that it's >> ok and either merge it into master or tell me that I can do it? > >> >> +** New macro 'elisp-tests-with-temp-buffer' >> +which helps writing tests for functions that should change buffers in >> +specific ways or manipulate point or mark positions. >> + >> +--- > > I don't this should be documented in NEWS since the macro is being added > to a test file, so it's not part of Emacs' libraries. Also, the format > of the NEWS entry is wrong in the same way as the next one (see below). I deleted that from etc/NEWS. >> +With a prefix argument, it marks that many defuns or extends the >> +region by the appropriate number of defuns. With negative prefix >> +argument it marks defuns in the opposite direction and also changes >> +the direction of selecting for subsequent uses of @code{mark-defun}. > > This doesn't say what exactly happens with zero as argument. The code > seems to do something odd. Perhaps it should just be a user-error > instead? Or maybe just a nop. Good catch. I guess a no-op is fine. >> modified etc/NEWS >> @@ -363,6 +363,15 @@ words where first character is upper rather than title case, e.g., >> "DŽungla" instead of "Džungla". >> >> >> +** New behavior of 'mark-defun' implemented >> +Prefix argument selects that many (or that many more) defuns. >> +Negative prefix arg flips the direction of selection. Also, >> +'mark-defun' between defuns correctly selects N following defuns (or >> +-N previous for negative arguments). Finally, comments preceding the >> +defun are selected unless they are separated from the defun by a blank >> +line. >> + >> ++++ >> * Changes in Specialized Modes and Packages in Emacs 26.1 >> > > This entry should go before the page separator, and the "+++" should go > on the line just above the entry, not after it. That one I do not understand. This means that "+++" goes essentially _to the previous entry_, which doesn't seem to make sense (especially when viewing NEWS folded, which I assume everyone does, right?). >> +(defun beginning-of-defun-comments (&optional arg) > >> + (let (nbobp) >> + (while (progn >> + (setq nbobp (zerop (forward-line -1))) >> + (and (not (looking-at "^\\s-*$")) >> + (beginning-of-defun--in-emptyish-line-p) >> + nbobp))) >> + (when nbobp >> + (forward-line 1)))) > > > The looking-at call is redundant, right? Anyway, can't that all be Hm. Probably yes, although this seems to be not very well documented in `forward-comment's docs. > replaced by just > > (forward-comment (- (point))) > (unless (bolp) > (forward-line 1)) My tests say no. Consider these contents of a buffer: --8<---------------cut here---------------start------------->8--- ;; Comment at the bob (defun func (arg) "docstring" body) --8<---------------cut here---------------end--------------->8--- Put the point inside the defun and call mark-defun. Your version marks the comment at the beginning, mine doesn't. >> +(defun mark-defun (&optional arg) > >> + (let (nbobp) >> + (while (progn >> + (setq nbobp (zerop (forward-line -1))) >> + (and (looking-at "^\\s-*$") >> + nbobp))) >> + (when nbobp >> + (forward-line 1)))) > > I think this can be just > > (skip-chars-backward "[:space:]\n") > (unless (bolp) > (forward-line 1)) This OTOH does pass my tests, though I guess it would be clearer to replace (bolp) with (bobp) in the above code (if I understand correctly, in this situation they should be equivalent). WDYT? Thanks a lot, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Apr 2017 08:27:01 +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: To: Glenn Morris Cc: Eli Zaretskii , 21072@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149155358825808 (code B ref 21072); Fri, 07 Apr 2017 08:27:01 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Apr 2017 08:26:28 +0000 Received: from localhost ([127.0.0.1]:35708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwPDw-0006iC-5X for submit@debbugs.gnu.org; Fri, 07 Apr 2017 04:26:28 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:49557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwPDu-0006i4-Bx for 21072@debbugs.gnu.org; Fri, 07 Apr 2017 04:26:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id AEA9DE6BE5; Fri, 7 Apr 2017 10:26:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 z4uv41KAOsDJ; Fri, 7 Apr 2017 10:26:22 +0200 (CEST) Received: from localhost (apn-37-248-138-13.dynamic.gprs.plus.pl [37.248.138.13]) by mail.mojserwer.eu (Postfix) with ESMTPSA id A03DDE6BD6; Fri, 7 Apr 2017 10:26:22 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Fri, 07 Apr 2017 10:26:54 +0200 Message-ID: <87zifs8vxt.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-02, at 22:22, Glenn Morris wrote: > Marcin Borkowski wrote: > >> OK, I pushed the branch "fix-bug-21072". Can anyone confirm that it's >> ok and either merge it into master or tell me that I can do it? > > Nitpick: branch should have been called fix/bug-21072 > (given lack of response to http://debbugs.gnu.org/25610, I can't blame you) OK, I'll fix that. Thanks. > While I'm nitpicking, please don't cc emacs-devel on bug reports. > > :) Well, I guess the CC was somehow justified in that I wanted to ask people about the new features I introduced while fixing an old bug. Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Apr 2017 14:42: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14915760942552 (code B ref 21072); Fri, 07 Apr 2017 14:42:02 +0000 Received: (at 21072) by debbugs.gnu.org; 7 Apr 2017 14:41:34 +0000 Received: from localhost ([127.0.0.1]:36661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwV4w-0000f5-AU for submit@debbugs.gnu.org; Fri, 07 Apr 2017 10:41:34 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:33701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwV4v-0000et-0X for 21072@debbugs.gnu.org; Fri, 07 Apr 2017 10:41:33 -0400 Received: by mail-oi0-f46.google.com with SMTP id b187so88318148oif.0 for <21072@debbugs.gnu.org>; Fri, 07 Apr 2017 07:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=g36BdyzYm0VMyeF8JGFtg2iqauOhVPzriMSz8JLEoiA=; b=KQOdsN+sByFSjwa2H5ylQIrx35XqQMn/Fdq+GDc8k7Xe+OctEYBK2cmCigoteG4CSR 95BXBTaelfubWAOYdu2m5dA1H/+73wg38ZDImTW5hNmhvME3cer8jOI7kti3UXpDvkWl KqLKwQSZcPwKqgqF51fbWi4p31XfvCV0bw+cEcrqK+U4Yc5kd/V5fMjHuHLrFgXarxT3 7/QBLxwT2BjxMa0lH0hUDSEF5mLf+4YvIc0SWiiqNtCISnulUx865cQPsqz1mhI2peU0 FWujFPYKmbz5COsk6jPVSiuP/D0q+SC40phOZtHBbPL49AE8mEg8cPZ6IWQO//JGmt3Z IzMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=g36BdyzYm0VMyeF8JGFtg2iqauOhVPzriMSz8JLEoiA=; b=TMcJ+PhVvl/tcPIk6BSf5KhLHhxxoSYvIpz0QcEEV8pVK8kIa0aqsJBkhvRDfjFET8 fmrt6eT6MjMNucx3vsQSs3VJVFCx8iN5Ori+JpawqFVJYm2izkFjkKd8GMlEoVzfgxBo y3kkd5aw3xTwVbuZkjSr72bQ6b9MtApWL00I9ptNv2UfuQYRbObHy1Gh0ZrT+x0MdB0n QcpCr3zBmyZeLkWZV335NiVcccHffwmOD6X0cQp4EWSyt4sbachb0w0TjUMyxXcHwx9a frKJGL+8BH69RkNZZDNArdp1ILo8nPMk4m9v3g1pXFos2pPLMZnZ0MuM0PgqmfvxUA9m yZqA== X-Gm-Message-State: AFeK/H18AlREroG68f++RzhWxX3bJLwUkCGjenjjbBp82d91fYfmHXIdTVlq9hPtsiJHybD3DBt44OLco4th6g== X-Received: by 10.202.74.87 with SMTP id x84mr23014343oia.187.1491576087037; Fri, 07 Apr 2017 07:41:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.80.133 with HTTP; Fri, 7 Apr 2017 07:41:26 -0700 (PDT) In-Reply-To: <871st4aal7.fsf@jane> References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.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> From: Noam Postavsky Date: Fri, 7 Apr 2017 10:41:26 -0400 X-Google-Sender-Auth: bH5H33ifFjofkLVf9VT7uhvMSOo Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On Fri, Apr 7, 2017 at 4:25 AM, Marcin Borkowski wrote: >>> +** New behavior of 'mark-defun' implemented [...] >>> +line. >>> + >>> ++++ >>> * Changes in Specialized Modes and Packages in Emacs 26.1 >>> >> >> This entry should go before the page separator, and the "+++" should go >> on the line just above the entry, not after it. > > That one I do not understand. This means that "+++" goes essentially > _to the previous entry_, which doesn't seem to make sense (especially > when viewing NEWS folded, which I assume everyone does, right?). Hmm, no, I wasn't really aware of folding (you mean via `outline-hide-sublevels', right?). I guess the convention wasn't made with folding in mind, but the "+++" and "---" markup is just temporary anyway. > >>> +(defun beginning-of-defun-comments (&optional arg) >> >>> + (let (nbobp) >>> + (while (progn >>> + (setq nbobp (zerop (forward-line -1))) >>> + (and (not (looking-at "^\\s-*$")) >>> + (beginning-of-defun--in-emptyish-line-p) >>> + nbobp))) >>> + (when nbobp >>> + (forward-line 1)))) >> >> >> The looking-at call is redundant, right? Anyway, can't that all be >> replaced by just >> >> (forward-comment (- (point))) >> (unless (bolp) >> (forward-line 1)) > > My tests say no. Oh, right, I thought it was doing backward-comment, but the difference is that it stops at blank lines, thus the *non-redundant* looking-at call. I wonder if that's a sensible thing to do for languages that have multiline comments though, e.g. Javascript: /* This function returns 0 */ function foo () { return 0; } Although we might say that such comments should have "*" on the empty lines. > >>> +(defun mark-defun (&optional arg) >> >>> + (let (nbobp) >>> + (while (progn >>> + (setq nbobp (zerop (forward-line -1))) >>> + (and (looking-at "^\\s-*$") >>> + nbobp))) >>> + (when nbobp >>> + (forward-line 1)))) >> >> I think this can be just >> >> (skip-chars-backward "[:space:]\n") >> (unless (bolp) >> (forward-line 1)) > > This OTOH does pass my tests, though I guess it would be clearer to > replace (bolp) with (bobp) in the above code (if I understand correctly, > in this situation they should be equivalent). WDYT? Yes, I believe they are equivalent. I guess using bobp would explain better when this happens, though I feel bolp better explains why we're doing forward-line. I don't think it matters very much either way, go with whichever you like best. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Apr 2017 12:35:01 +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: To: Noam Postavsky Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149251888120187 (code B ref 21072); Tue, 18 Apr 2017 12:35:01 +0000 Received: (at 21072) by debbugs.gnu.org; 18 Apr 2017 12:34:41 +0000 Received: from localhost ([127.0.0.1]:53530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0SLB-0005FX-36 for submit@debbugs.gnu.org; Tue, 18 Apr 2017 08:34:41 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:44823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0SL9-0005FP-JQ for 21072@debbugs.gnu.org; Tue, 18 Apr 2017 08:34:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 75DD1E6888; Tue, 18 Apr 2017 14:34:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 QpVV0lFNHaPI; Tue, 18 Apr 2017 14:34:31 +0200 (CEST) Received: from localhost (unknown [83.13.149.242]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 1B289E6789; Tue, 18 Apr 2017 14:34:31 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87bmu6icea.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Tue, 18 Apr 2017 14:35:13 +0200 Message-ID: <87tw5l7v26.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.8 (/) On 2017-04-07, at 16:41, Noam Postavsky wrote: >>> This entry should go before the page separator, and the "+++" should go >>> on the line just above the entry, not after it. >> >> That one I do not understand. This means that "+++" goes essentially >> _to the previous entry_, which doesn't seem to make sense (especially >> when viewing NEWS folded, which I assume everyone does, right?). > > Hmm, no, I wasn't really aware of folding (you mean via > `outline-hide-sublevels', right?). Actually, via Org-mode. Is there anyone who does that without Org-mode? Out of curiosity: why??? > I guess the convention wasn't made with folding in mind, but the "+++" > and "---" markup is just temporary anyway. OK. Anyway, I fixed that. > [...] > > Oh, right, I thought it was doing backward-comment, but the difference > is that it stops at blank lines, thus the *non-redundant* looking-at > call. > > I wonder if that's a sensible thing to do for languages that have > multiline comments though, e.g. Javascript: > > /* > > This function returns 0 > > */ > function foo () { > return 0; > } > > Although we might say that such comments should have "*" on the empty lines. Definitely. OTOH, what if they don't...? I'm not sure how to detect such a situation. Any ideas? Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Apr 2017 14:05: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: To: Marcin Borkowski , Noam Postavsky Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149252426229470 (code B ref 21072); Tue, 18 Apr 2017 14:05:02 +0000 Received: (at 21072) by debbugs.gnu.org; 18 Apr 2017 14:04:22 +0000 Received: from localhost ([127.0.0.1]:54852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0Tjx-0007fE-Pe for submit@debbugs.gnu.org; Tue, 18 Apr 2017 10:04:22 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:17919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0Tjw-0007f1-Jt for 21072@debbugs.gnu.org; Tue, 18 Apr 2017 10:04:21 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v3IE4EUn015531 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Apr 2017 14:04:14 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v3IE4DL2020411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Apr 2017 14:04:13 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v3IE4BYo018646; Tue, 18 Apr 2017 14:04:11 GMT MIME-Version: 1.0 Message-ID: <99032fe6-1589-4972-8a43-6748007445af@default> Date: Tue, 18 Apr 2017 07:04:10 -0700 (PDT) From: Drew Adams References: <87o9ydrzkr.fsf@mbork.pl> <87bmu6icea.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> In-Reply-To: <87tw5l7v26.fsf@jane> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6767.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -5.1 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > Hmm, no, I wasn't really aware of folding (you mean via > > `outline-hide-sublevels', right?). >=20 > Actually, via Org-mode. Is there anyone who does that > without Org-mode? Out of curiosity: why??? Yes, I do. ;-) And so do you, if you use `C-h n' (`view-emacs-news') and you sometimes hide sublevels there. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Apr 2017 14:39: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: To: Drew Adams Cc: mbork@mbork.pl, 21072@debbugs.gnu.org, monnier@iro.umontreal.ca, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149252630932555 (code B ref 21072); Tue, 18 Apr 2017 14:39:02 +0000 Received: (at 21072) by debbugs.gnu.org; 18 Apr 2017 14:38:29 +0000 Received: from localhost ([127.0.0.1]:54862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0UGz-0008T0-JV for submit@debbugs.gnu.org; Tue, 18 Apr 2017 10:38:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0UGy-0008Sp-By for 21072@debbugs.gnu.org; Tue, 18 Apr 2017 10:38:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0UGs-00018P-8E for 21072@debbugs.gnu.org; Tue, 18 Apr 2017 10:38:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0UGl-00015h-8v; Tue, 18 Apr 2017 10:38:15 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2621 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d0UGk-0007DN-Ew; Tue, 18 Apr 2017 10:38:14 -0400 Date: Tue, 18 Apr 2017 17:38:49 +0300 Message-Id: <83r30pdbly.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <99032fe6-1589-4972-8a43-6748007445af@default> (message from Drew Adams on Tue, 18 Apr 2017 07:04:10 -0700 (PDT)) References: <87o9ydrzkr.fsf@mbork.pl> <87bmu6icea.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> <99032fe6-1589-4972-8a43-6748007445af@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Tue, 18 Apr 2017 07:04:10 -0700 (PDT) > From: Drew Adams > Cc: 21072@debbugs.gnu.org, Stefan Monnier > > > > Hmm, no, I wasn't really aware of folding (you mean via > > > `outline-hide-sublevels', right?). > > > > Actually, via Org-mode. Is there anyone who does that > > without Org-mode? Out of curiosity: why??? > > Yes, I do. ;-) And so do I. > And so do you, if you use `C-h n' (`view-emacs-news') and > you sometimes hide sublevels there. Right. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Apr 2017 00:04: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149256019426267 (code B ref 21072); Wed, 19 Apr 2017 00:04:02 +0000 Received: (at 21072) by debbugs.gnu.org; 19 Apr 2017 00:03:14 +0000 Received: from localhost ([127.0.0.1]:55331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0d5W-0006pb-K8 for submit@debbugs.gnu.org; Tue, 18 Apr 2017 20:03:14 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:35830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0d5V-0006pO-EI for 21072@debbugs.gnu.org; Tue, 18 Apr 2017 20:03:14 -0400 Received: by mail-io0-f194.google.com with SMTP id d203so1844036iof.2 for <21072@debbugs.gnu.org>; Tue, 18 Apr 2017 17:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=knq3O4s4p41rttR8blvvC+Q4/I9G5VO6GTOZkXCWSeY=; b=e4cntT+7BIR8XRrcBjF8fNtCQMzIdo3BrvWsdPEelziTzBKY8Yn+bwxXVE1C3wgUIQ TTP9EglTfB9CKCS7ylMQM93lmd3hirKDMg4edw6uU/Ejj5woKTEQeWFmaZa2zXLBFKu5 GXn7q8pazoJ/6PNXAilZJzHiYD0yEayEVqMCCwl5vUaVZEEwgs0kzG3mfeDa19Ggru1/ UNq7q7iSkMMVyFRgv61amkH68ZcTucY3cCQYZH1aRiUu9tb/oM4bI6Ikl47uyEtMT4eL SKlmLwvTfbAnWWzLyhDj7NK8pdCBDGBl/uxiMTa5/mZUSDL1hU8PuiJiIWVgyq+mHXuH /hfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=knq3O4s4p41rttR8blvvC+Q4/I9G5VO6GTOZkXCWSeY=; b=U1/xbGK2Hbrta7dkeO63e7UmE00IzLPDDCcrkSJURElA1WrC1gzztLITSNZpVRZhHU c+L3DJpumHsVIV+BEiSevNm4b1lW258EKlR+lAyifl9R9YKVeWCuJufIC7NNmIpNML7M U38NKW7Sw7h52dsHrYgGCNsJbGkoXDBKZiV4zeKcYB1PxsTQJNdpZeXKGTOMA7anDcwq o/rONo6MN8vcJKGTrf/eH4Sl+W97QCnRAZW3u8Gg51kcc/ujIXizobuF4X/F1YgJ4Oir hfFCj+AzjbDlTYxzsc9Z5zucMwiyT6Hvho2XWa3ed15EfKU/wE+XTpR4pdr9uujQkhRo SvIg== X-Gm-Message-State: AN3rC/7KCvO97yFK6IdfPnUFl0SmRscDk01K43SfQuablwNDtW4FbPIt JW1ILYYe4/qCug== X-Received: by 10.107.130.99 with SMTP id e96mr633615iod.38.1492560187710; Tue, 18 Apr 2017 17:03:07 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b91sm2337659itd.26.2017.04.18.17.03.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Apr 2017 17:03:06 -0700 (PDT) From: npostavs@users.sourceforge.net 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> Date: Tue, 18 Apr 2017 20:04:35 -0400 In-Reply-To: <87tw5l7v26.fsf@jane> (Marcin Borkowski's message of "Tue, 18 Apr 2017 14:35:13 +0200") Message-ID: <877f2hs1nw.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Marcin Borkowski writes: >> Oh, right, I thought it was doing backward-comment, but the difference >> is that it stops at blank lines, thus the *non-redundant* looking-at >> call. >> >> I wonder if that's a sensible thing to do for languages that have >> multiline comments though, e.g. Javascript: >> >> /* >> >> This function returns 0 >> >> */ >> function foo () { >> return 0; >> } >> >> Although we might say that such comments should have "*" on the empty lines. > > Definitely. OTOH, what if they don't...? I'm not sure how to detect > such a situation. Any ideas? (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (while (let ((pt (prog1 (point) (forward-line -1))) (ppss (syntax-ppss))) (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) ((and (parse-partial-sexp (point) (line-end-position) nil t ppss) (not (bolp)) (eolp))) (t (goto-char pt) nil))))) However there will always be some comment style that doesn't work, e.g. // Some description followed by a blank. function name(arg) { } Another option is to give up the comment marking, it seems a bit complicated to implement and explain to users. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: John Mastro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Apr 2017 00:36: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: To: 21072@debbugs.gnu.org Cc: Marcin Borkowski , Stefan Monnier , Noam Postavsky Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149256213529279 (code B ref 21072); Wed, 19 Apr 2017 00:36:02 +0000 Received: (at 21072) by debbugs.gnu.org; 19 Apr 2017 00:35:35 +0000 Received: from localhost ([127.0.0.1]:55352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0dao-0007cB-Uw for submit@debbugs.gnu.org; Tue, 18 Apr 2017 20:35:35 -0400 Received: from mail-qt0-f176.google.com ([209.85.216.176]:34446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0dam-0007bx-Qq for 21072@debbugs.gnu.org; Tue, 18 Apr 2017 20:35:33 -0400 Received: by mail-qt0-f176.google.com with SMTP id c45so7748872qtb.1 for <21072@debbugs.gnu.org>; Tue, 18 Apr 2017 17:35:32 -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=Q5Je8rLUBeiuk80d6pctmDFO5LhXd1VvjGX1pl7t4Zw=; b=Wt4W+f29KsrJbUhOml6ZqeABdiRjPBY7Swk8HWPctTXkQukebx4/UAqlh4lOjUm3Pt DT4fXsIfo1XgN3/03OVlchzjqM7klusVf6ZpNKZME8nm7uxy+ZBzmnts6bMvG0aCUOZQ vSGXLu92R7mu5FyRP+5GHuI+yWm1utJ3bQH86Cap6b2ZkVcc2Iem+27SKvBkAxwSa9JO n5aH/H8K4JULvQbDrqAPqDqB2n/NIX1HKirrsO305nX5PhJ+FCFjeEgkOpKqowZUZNgN LHmVZZoBGE9GGL6L8bVA5Rkse9hARO0kCc5h55c/y6S9oIYsVIh2OFusQf8HZt0Z/zql bdxg== 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=Q5Je8rLUBeiuk80d6pctmDFO5LhXd1VvjGX1pl7t4Zw=; b=ShcwewlBSd4zmA7MBRQhNiy/QnH7FBkZNjSstRhVpQPDSnsdB0iksOY41ByciPeiaP 4Y2FgFMuA7Tl9D2HrYPLgh9ayktgHMmn/xDxX4u1jPLeFhcN/LJOATRh/1nwk9eph8sR qqORe/kF3Nj/xj0fQzRrV1gLzfiXfr3R+EUdd9ed/Qk0HDyNDb9pI9WECnaB44ywsQpx 6F2rGhFbymXn4o2TYLMMDnxJNVq77O9cU3W1VQPOFROjCCWU4W/ARbRS1EhtMDdsAAyz U8RIx7QH7X5YoYJpk0khvSi8TisTqBx+LjsxekLhyJMMaMJX3PDgdTZIlYTTX1wgTtVA peCA== X-Gm-Message-State: AN3rC/58DTTfVrjO8Esyupu40pE7th1Gn0jigNEMeipkgHZLBmO0C5iK 0+rVUXLgSaJrvSwUISHX+ZNjxvmDPw== X-Received: by 10.237.52.162 with SMTP id x31mr131999qtd.263.1492562127125; Tue, 18 Apr 2017 17:35:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.32.9 with HTTP; Tue, 18 Apr 2017 17:35:06 -0700 (PDT) In-Reply-To: <877f2hs1nw.fsf@users.sourceforge.net> 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> From: John Mastro Date: Tue, 18 Apr 2017 17:35:06 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) wrote: > (defun beginning-of-defun-comments (&optional arg) > "Move to the beginning of ARGth defun, including comments." > (interactive "^p") > (unless arg (setq arg 1)) > (beginning-of-defun arg) > (while (let ((pt (prog1 (point) (forward-line -1))) > (ppss (syntax-ppss))) > (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) > ((and (parse-partial-sexp > (point) (line-end-position) nil t ppss) > (not (bolp)) (eolp))) > (t (goto-char pt) nil))))) > > However there will always be some comment style that doesn't work, e.g. > > // Some description followed by a blank. > > function name(arg) { > > } > > Another option is to give up the comment marking, it seems a bit > complicated to implement and explain to users. 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. John John From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) 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: To: 21072@debbugs.gnu.org Cc: Marcin Borkowski , Stefan Monnier , Noam Postavsky Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149264929314168 (code B ref 21072); Thu, 20 Apr 2017 00:49:02 +0000 Received: (at 21072) by debbugs.gnu.org; 20 Apr 2017 00:48:13 +0000 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 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 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) MIME-Version: 1.0 Received: by 10.237.32.9 with HTTP; Wed, 19 Apr 2017 17:47:46 -0700 (PDT) In-Reply-To: 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> From: John Mastro Date: Wed, 19 Apr 2017 17:47:46 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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")) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Apr 2017 12:11: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: To: John Mastro Cc: Noam Postavsky , 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14926902289254 (code B ref 21072); Thu, 20 Apr 2017 12:11:02 +0000 Received: (at 21072) by debbugs.gnu.org; 20 Apr 2017 12:10:28 +0000 Received: from localhost ([127.0.0.1]:58056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1Aup-0002PC-Ny for submit@debbugs.gnu.org; Thu, 20 Apr 2017 08:10:27 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:38863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1Auo-0002P3-6v for 21072@debbugs.gnu.org; Thu, 20 Apr 2017 08:10:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id CAE77E66A8; Thu, 20 Apr 2017 14:10:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 GL1j0msECLU6; Thu, 20 Apr 2017 14:10:20 +0200 (CEST) Received: from localhost (apn-31-0-23-7.dynamic.gprs.plus.pl [31.0.23.7]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 27084E602D; Thu, 20 Apr 2017 14:10:20 +0200 (CEST) References: <87o9ydrzkr.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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Thu, 20 Apr 2017 14:11:04 +0200 Message-ID: <8737d3b7on.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-20, at 02:47, John Mastro wrote: > 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")) Hi John, this definitely does not work - my `beginning-of-defun-comments' stops at the first blank line, yours does not. Thanks anyway, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2017 12:24: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: To: npostavs@users.sourceforge.net Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149277743512647 (code B ref 21072); Fri, 21 Apr 2017 12:24:02 +0000 Received: (at 21072) by debbugs.gnu.org; 21 Apr 2017 12:23:55 +0000 Received: from localhost ([127.0.0.1]:59981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1XbP-0003Hu-DD for submit@debbugs.gnu.org; Fri, 21 Apr 2017 08:23:55 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:36302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1XbN-0003Hl-At for 21072@debbugs.gnu.org; Fri, 21 Apr 2017 08:23:53 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id E0CDEE6BBE; Fri, 21 Apr 2017 14:23:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 Jc-_5mGGnADq; Fri, 21 Apr 2017 14:23:48 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id ABB2FE602D; Fri, 21 Apr 2017 14:23:48 +0200 (CEST) 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> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <877f2hs1nw.fsf@users.sourceforge.net> Date: Fri, 21 Apr 2017 14:24:34 +0200 Message-ID: <87zifa9ce5.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-19, at 02:04, npostavs@users.sourceforge.net wrote: > Marcin Borkowski writes: > >>> Oh, right, I thought it was doing backward-comment, but the difference >>> is that it stops at blank lines, thus the *non-redundant* looking-at >>> call. >>> >>> I wonder if that's a sensible thing to do for languages that have >>> multiline comments though, e.g. Javascript: >>> >>> /* >>> >>> This function returns 0 >>> >>> */ >>> function foo () { >>> return 0; >>> } >>> >>> Although we might say that such comments should have "*" on the empty lines. >> >> Definitely. OTOH, what if they don't...? I'm not sure how to detect >> such a situation. Any ideas? > > (defun beginning-of-defun-comments (&optional arg) > "Move to the beginning of ARGth defun, including comments." > (interactive "^p") > (unless arg (setq arg 1)) > (beginning-of-defun arg) > (while (let ((pt (prog1 (point) (forward-line -1))) > (ppss (syntax-ppss))) > (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) > ((and (parse-partial-sexp > (point) (line-end-position) nil t ppss) > (not (bolp)) (eolp))) > (t (goto-char pt) nil))))) Still not there - I tried first on Elisp, like this: ;; A comment (defun ...) and it left the point at the end of the "A comment" line instead of at the beginning... > However there will always be some comment style that doesn't work, e.g. > > // Some description followed by a blank. > > function name(arg) { > > } > > Another option is to give up the comment marking, it seems a bit > complicated to implement and explain to users. I'm tempted to leave it is it is in my branch. For one, I'm a bit tired by all this and I'd like to move on; also, as you said above, there is little hope to do it "100% correctly", and I guess my solution may be good enough. (I'm pretty sure it's better than the status quo, at least.) I wouldn't like to resign from marking comments; I think it is pretty useful. So I'm going to delete the branch with the wrong name and push another one, with the fixes we discussed earlier. Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Apr 2017 12:30: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: To: 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149277774913166 (code B ref 21072); Fri, 21 Apr 2017 12:30:02 +0000 Received: (at 21072) by debbugs.gnu.org; 21 Apr 2017 12:29:09 +0000 Received: from localhost ([127.0.0.1]:59996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1XgT-0003QI-5p for submit@debbugs.gnu.org; Fri, 21 Apr 2017 08:29:09 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:36550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1XgS-0003QB-2M for 21072@debbugs.gnu.org; Fri, 21 Apr 2017 08:29:08 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 5BBDBE6BBE for <21072@debbugs.gnu.org>; Fri, 21 Apr 2017 14:29:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 oWE3Ah2HYy38 for <21072@debbugs.gnu.org>; Fri, 21 Apr 2017 14:29:02 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 08F88E602D for <21072@debbugs.gnu.org>; Fri, 21 Apr 2017 14:29:02 +0200 (CEST) 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> <87zifa9ce5.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <87zifa9ce5.fsf@jane> Date: Fri, 21 Apr 2017 14:29:51 +0200 Message-ID: <87y3uu9c5c.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi all, as I mentioned a few minutes ago, I pushed the fix/bug-21072 branch with a few fixes discussed in this thread. If it is in good enoug shape to merge into master, please tell me and I'll do it; if not, I'll fix what should be fixed (commit messages?) Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2017 18:04: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149288422120825 (code B ref 21072); Sat, 22 Apr 2017 18:04:02 +0000 Received: (at 21072) by debbugs.gnu.org; 22 Apr 2017 18:03:41 +0000 Received: from localhost ([127.0.0.1]:34656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1zNl-0005Pp-G0 for submit@debbugs.gnu.org; Sat, 22 Apr 2017 14:03:41 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:32868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1zNj-0005Pc-C8 for 21072@debbugs.gnu.org; Sat, 22 Apr 2017 14:03:39 -0400 Received: by mail-it0-f67.google.com with SMTP id z67so5779603itb.0 for <21072@debbugs.gnu.org>; Sat, 22 Apr 2017 11:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=nBu5ytbMhZ96u+FkrQ8+zXaZp78dmTUxtueQJgiwzcI=; b=kgeDewweGLjunNZvS7HeHRJTBnH52Ow48u6mZopGD+k5Scgfs6X/CgOR6V21gv0zc0 mvRHFCq3KGzAldAFPW8+1Qadi+8ClMiKEf6gQtPVBg0eWtOnvKHQdfz+N8gHip/lb3Ok ymjdEAAwG7RAla1ybpR/EfFORNy0+jzmngjHsrPBcrSKF+8TltYbiZLsUT52mMUpnHGP QN+EhL/HWoRbgO3lYXpPRu3loglRR79b4N1ne4BVcn2D54ZSBV9MebrGb61ToGhIzNkI z2DFV/mqhur3fYeLz7bbpFlF4CwWH7XwTAtGRW5W1KPJkf1h928OEjjBXwqI5W0EC7YW 0rKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=nBu5ytbMhZ96u+FkrQ8+zXaZp78dmTUxtueQJgiwzcI=; b=eac4aIyQNwEaIadmKjeCYXXVA8LAvJ4F9cgZflPGDYdPcpGc8dcEdO8Z+tiQp9bVzn 1g3ZI4eyVPcE2J+3FG9BHe0NCdgSd9apUjsOwlDWSXtkRu8aEWg+El2ntG4BroNVlpFw 62TCvzYYNjtGyi2zPsrZRMqlXIe5gjn1RY4BIH2UQaL4niwBiodWDILn+Nt4iX0NoZ9i VdG81jhGjsuqO01W+t4gAg97uVtaO/waO0a1J/+vCe69vognXMLsCo9LLCUtleB0qoQQ nvrquKzXbShmpy2Z1TyIWxE8Nz499ElC5bIonQ7weojkZYCK9gZIufK87BPolO3g+mBy ynDA== X-Gm-Message-State: AN3rC/6eowsqkUophNN7hkpL9VR6Y1K/Ljwu8P8z/arQi3TZ3+gXocWl kURQgv3JFmRh7w== X-Received: by 10.36.40.81 with SMTP id h78mr5100281ith.44.1492884213830; Sat, 22 Apr 2017 11:03:33 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id u133sm2896010iod.21.2017.04.22.11.03.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Apr 2017 11:03:33 -0700 (PDT) From: npostavs@users.sourceforge.net 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> <87zifa9ce5.fsf@jane> Date: Sat, 22 Apr 2017 14:05:03 -0400 In-Reply-To: <87zifa9ce5.fsf@jane> (Marcin Borkowski's message of "Fri, 21 Apr 2017 14:24:34 +0200") Message-ID: <87shl0pbcg.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Marcin Borkowski writes: > On 2017-04-19, at 02:04, npostavs@users.sourceforge.net wrote: > >> Marcin Borkowski writes: >> >>>> Oh, right, I thought it was doing backward-comment, but the difference >>>> is that it stops at blank lines, thus the *non-redundant* looking-at >>>> call. >>>> >>>> I wonder if that's a sensible thing to do for languages that have >>>> multiline comments though, e.g. Javascript: >>>> >>>> /* >>>> >>>> This function returns 0 >>>> >>>> */ >>>> function foo () { >>>> return 0; >>>> } >>>> >>>> Although we might say that such comments should have "*" on the empty lines. >>> >>> Definitely. OTOH, what if they don't...? I'm not sure how to detect >>> such a situation. Any ideas? >> >> (defun beginning-of-defun-comments (&optional arg) [...] > > Still not there - I tried first on Elisp, like this: > > ;; A comment > (defun ...) > > and it left the point at the end of the "A comment" line instead of at > the beginning... Hmm, I don't get that, although I did miss an inf loop when the comment is at beginning of buffer. Here is a fixed version: (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (while (let ((pt (point)) (ppss (and (zerop (forward-line -1)) (syntax-ppss)))) (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) ((and ppss (parse-partial-sexp (point) (line-end-position) nil t ppss) (not (bolp)) (eolp))) (t (goto-char pt) nil))))) > > I'm tempted to leave it is it is in my branch. For one, I'm a bit tired > by all this and I'd like to move on; also, as you said above, there is > little hope to do it "100% correctly", and I guess my solution may be > good enough. (I'm pretty sure it's better than the status quo, at > least.) Yeah, since there's no perfect answer, I think it's fine if you just go with whichever version you like best. If people disagree, we'll find out in bug reports :) > as I mentioned a few minutes ago, I pushed the fix/bug-21072 branch with > a few fixes discussed in this thread. If it is in good enoug shape to > merge into master, please tell me and I'll do it; if not, I'll fix what > should be fixed (commit messages?) Looks good to me (apart from the commit messages). From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2017 12:18:01 +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: To: npostavs@users.sourceforge.net Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149303622620270 (code B ref 21072); Mon, 24 Apr 2017 12:18:01 +0000 Received: (at 21072) by debbugs.gnu.org; 24 Apr 2017 12:17:06 +0000 Received: from localhost ([127.0.0.1]:37224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2cvS-0005Gs-1P for submit@debbugs.gnu.org; Mon, 24 Apr 2017 08:17:06 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:54439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2cvR-0005Gk-07 for 21072@debbugs.gnu.org; Mon, 24 Apr 2017 08:17:05 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B62B5E632F; Mon, 24 Apr 2017 14:17:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 ttDTzrdw302i; Mon, 24 Apr 2017 14:17:00 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id D0865E6042; Mon, 24 Apr 2017 14:16:59 +0200 (CEST) References: <87o9ydrzkr.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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <87shl0pbcg.fsf@users.sourceforge.net> Date: Mon, 24 Apr 2017 14:17:47 +0200 Message-ID: <87shky9ez8.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-22, at 20:05, npostavs@users.sourceforge.net wrote: >> Still not there - I tried first on Elisp, like this: >> >> ;; A comment >> (defun ...) >> >> and it left the point at the end of the "A comment" line instead of at >> the beginning... > > Hmm, I don't get that, although I did miss an inf loop when the comment > is at beginning of buffer. Here is a fixed version: > > (defun beginning-of-defun-comments (&optional arg) > "Move to the beginning of ARGth defun, including comments." > (interactive "^p") > (unless arg (setq arg 1)) > (beginning-of-defun arg) > (while (let ((pt (point)) > (ppss (and (zerop (forward-line -1)) (syntax-ppss)))) > (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) > ((and ppss > (parse-partial-sexp > (point) (line-end-position) nil t ppss) > (not (bolp)) (eolp))) > (t (goto-char pt) nil))))) Still the same here, also in emacs -Q. >> I'm tempted to leave it is it is in my branch. For one, I'm a bit tired >> by all this and I'd like to move on; also, as you said above, there is >> little hope to do it "100% correctly", and I guess my solution may be >> good enough. (I'm pretty sure it's better than the status quo, at >> least.) > > Yeah, since there's no perfect answer, I think it's fine if you just go > with whichever version you like best. If people disagree, we'll find > out in bug reports :) ;-) >> as I mentioned a few minutes ago, I pushed the fix/bug-21072 branch with >> a few fixes discussed in this thread. If it is in good enoug shape to >> merge into master, please tell me and I'll do it; if not, I'll fix what >> should be fixed (commit messages?) > > Looks good to me (apart from the commit messages). What should they look like, then? Should I make all of them into the ChangeLog format, or just rebase/squash all of them so that there are two of them only (one for the testing tool and one for the beginning-of-defun)? Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2017 12:51: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149303825023238 (code B ref 21072); Mon, 24 Apr 2017 12:51:02 +0000 Received: (at 21072) by debbugs.gnu.org; 24 Apr 2017 12:50:50 +0000 Received: from localhost ([127.0.0.1]:37235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2dS5-00062k-PB for submit@debbugs.gnu.org; Mon, 24 Apr 2017 08:50:49 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:35902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2dS3-00062U-1G for 21072@debbugs.gnu.org; Mon, 24 Apr 2017 08:50:47 -0400 Received: by mail-io0-f194.google.com with SMTP id x86so49101600ioe.3 for <21072@debbugs.gnu.org>; Mon, 24 Apr 2017 05:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=h7EdSJB1sXnV9KlT4vxhA9emt43rKpQKjO3ND0ltDuU=; b=GTJYv0VOnOTai3MBBRDGtvhm2uBT6+EdXkLpFX+xvCbUnn97kLNXSKq0Ewetub7jAH zv6+eT3BaNi0qevVcp8OJv152pcVl6Mvbdy+aazwprIM86gsDSBCUiM3QChIZ3+6+ULN OJOv6YLCpNEvxGq/EZPvd47fthH3mQ2fNc9GARsS6GAP+hOLTOLHHMPh1xctCIbsy/91 aGa3Pl2cC48liiaaboYqXD1/z8U0W7etROEoLhp5BnPr05+q3Za91DN2Db5CUSaPkTzI MEvcWM56ug64wI98FLU491dOYEqgV5H0S5cgFpmHooH9kBpZcqUMRKDs3cjWqVGid3k8 fvTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=h7EdSJB1sXnV9KlT4vxhA9emt43rKpQKjO3ND0ltDuU=; b=U7K/N5d5van3zE7cAmmU8IK87mrExgiwGnjXdvUwmYBKYRe+v1CV/MrGo+jml71OYo 0wy6UXrdwyTCv+cluUNo7pTb7Pqt6aE90WAOSNDrQWJiGxWWWJcH2DCmFoos9L6UqD1l RFrfsTiqK+2i7YavdLAjjbD0ia8TkVefYpEGkD99pzX9UVhm41qd2xNBK9HV54+OXhxr F9qhYidSkYWGx/hBNL9C1JA9WzMR5OyitGG9a1uGBQVVchph0bOwr6o0LjfEk3e6CXqZ jNRFaAUFfPn8ebsoimPCzEot1uFrWw9pPdm50GLAD1Kqv0UkCbSVjImAfj6K6+EXG7BR LMrg== X-Gm-Message-State: AN3rC/4HsRmQHbBTZYjoz/ymdKi1hvgfvAjj5oAWdU0gamnRQlohwzV3 neWytREG3Oq9ZA== X-Received: by 10.107.141.2 with SMTP id p2mr8106840iod.161.1493038241175; Mon, 24 Apr 2017 05:50:41 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id r70sm7783636iod.37.2017.04.24.05.50.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Apr 2017 05:50:39 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> Date: Mon, 24 Apr 2017 08:52:10 -0400 In-Reply-To: <87shky9ez8.fsf@jane> (Marcin Borkowski's message of "Mon, 24 Apr 2017 14:17:47 +0200") Message-ID: <8737cyotmt.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Marcin Borkowski writes: > On 2017-04-22, at 20:05, npostavs@users.sourceforge.net wrote: > >>> Still not there - I tried first on Elisp, like this: >>> >>> ;; A comment >>> (defun ...) >>> >>> and it left the point at the end of the "A comment" line instead of at >>> the beginning... >> >> Hmm, I don't get that, although I did miss an inf loop when the comment >> is at beginning of buffer. Here is a fixed version: > > Still the same here, also in emacs -Q. Hmm, I was testing before now just by evaluating the changed functions after startup, I must have messed something up. I think this one might be okay. (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (while (let ((pt (line-beginning-position)) (ppss (and (zerop (forward-line -1)) (syntax-ppss)))) (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) ((and ppss (parse-partial-sexp (point) (line-end-position) nil t ppss) (not (bolp)) (eolp))) (t (goto-char pt) nil))))) >> >> Looks good to me (apart from the commit messages). Actually, now that I've applied this thing properly, I notice 2 test failures in batch mode: 2 unexpected results: FAILED mark-defun-arg-region-active FAILED mark-defun-no-arg-region-active They pass when run in interactive mode (I haven't looked into why). > > What should they look like, then? Should I make all of them into the > ChangeLog format, or just rebase/squash all of them so that there are > two of them only (one for the testing tool and one for the > beginning-of-defun)? Yeah, I would go ahead and squash them, since you need to rebase to fix commit messages anyway. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Apr 2017 11:44:01 +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: To: npostavs@users.sourceforge.net Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149312060226785 (code B ref 21072); Tue, 25 Apr 2017 11:44:01 +0000 Received: (at 21072) by debbugs.gnu.org; 25 Apr 2017 11:43:22 +0000 Received: from localhost ([127.0.0.1]:38867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2ysM-0006xx-9Y for submit@debbugs.gnu.org; Tue, 25 Apr 2017 07:43:22 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:58661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2ysK-0006xn-GK for 21072@debbugs.gnu.org; Tue, 25 Apr 2017 07:43:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9F410E630C; Tue, 25 Apr 2017 13:43:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 7ngwymHV9Y7h; Tue, 25 Apr 2017 13:43:13 +0200 (CEST) Received: from localhost (unknown [62.3.162.100]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 21321E62BC; Tue, 25 Apr 2017 13:43:13 +0200 (CEST) References: <87o9ydrzkr.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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <8737cyotmt.fsf@users.sourceforge.net> Date: Tue, 25 Apr 2017 13:43:38 +0200 Message-ID: <87wpa8yaol.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-24, at 14:52, npostavs@users.sourceforge.net wrote: > Marcin Borkowski writes: > >> On 2017-04-22, at 20:05, npostavs@users.sourceforge.net wrote: >> >>>> Still not there - I tried first on Elisp, like this: >>>> >>>> ;; A comment >>>> (defun ...) >>>> >>>> and it left the point at the end of the "A comment" line instead of at >>>> the beginning... >>> >>> Hmm, I don't get that, although I did miss an inf loop when the comment >>> is at beginning of buffer. Here is a fixed version: >> >> Still the same here, also in emacs -Q. > > Hmm, I was testing before now just by evaluating the changed functions > after startup, I must have messed something up. I think this one might > be okay. > > (defun beginning-of-defun-comments (&optional arg) > "Move to the beginning of ARGth defun, including comments." > (interactive "^p") > (unless arg (setq arg 1)) > (beginning-of-defun arg) > (while (let ((pt (line-beginning-position)) > (ppss (and (zerop (forward-line -1)) (syntax-ppss)))) > (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) > ((and ppss > (parse-partial-sexp > (point) (line-end-position) nil t ppss) > (not (bolp)) (eolp))) > (t (goto-char pt) nil))))) Quick tests show that you are right. I'd like to understand the code, too - that will take me a while. >>> Looks good to me (apart from the commit messages). > > Actually, now that I've applied this thing properly, I notice 2 test > failures in batch mode: > > 2 unexpected results: > FAILED mark-defun-arg-region-active > FAILED mark-defun-no-arg-region-active > > They pass when run in interactive mode (I haven't looked into why). That seems strange - all tests pass here with M-x ert. What do you mean by "batch mode"? >> What should they look like, then? Should I make all of them into the >> ChangeLog format, or just rebase/squash all of them so that there are >> two of them only (one for the testing tool and one for the >> beginning-of-defun)? > > Yeah, I would go ahead and squash them, since you need to rebase to fix > commit messages anyway. Will do. Thanks, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Apr 2017 12:13:01 +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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149312234229461 (code B ref 21072); Tue, 25 Apr 2017 12:13:01 +0000 Received: (at 21072) by debbugs.gnu.org; 25 Apr 2017 12:12:22 +0000 Received: from localhost ([127.0.0.1]:38900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2zKQ-0007f7-Df for submit@debbugs.gnu.org; Tue, 25 Apr 2017 08:12:22 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2zKO-0007eu-Qo for 21072@debbugs.gnu.org; Tue, 25 Apr 2017 08:12:21 -0400 Received: by mail-io0-f194.google.com with SMTP id h41so53512181ioi.1 for <21072@debbugs.gnu.org>; Tue, 25 Apr 2017 05:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=4QeP6jUr2o1PEPOaK1cYrKRRwvE+TrmYgvLHaKu+GZM=; b=pfTODri9tt5/+B/4XHo700JmXkX2Y1OhbbYlknPXmvCKA+IkJXvBCVcGgitLDEpgW0 deYgCNiSLXjbTpPNrdl52mv3AnFNhThP/c/U5Dd5i2oXrqf5YQph9oN9zHqdpD5Es2X9 18Dj0DHF90pqZTiXKJsY/VXUxdhd9lTWerQgwSUYqAFjKII6tQ7WdXtC8jPLZoP/9Knx KGrI5iHQyUUmpODTO9Db48vd/CU5t5xllB12lCY6Jjh/3ecfbXGinLNXVsXuUvU192pT 6eh/J6w/nDR2MlZZ2XrDGcG0rBMlv1lyXHPGOqmtL/USRnq16WkawlNhY8lp7huAf0ON Sgcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=4QeP6jUr2o1PEPOaK1cYrKRRwvE+TrmYgvLHaKu+GZM=; b=ZTfsxgMmAUJzR0CuSZbTIkgY3nz/UCrVYFdOgzX4yCIJVR6gHBF2rL/TMyo/dsXCgg qBMpuJeDPVBABIuK5Yt0hYdvoTsX7gzkUAzOo/c1TA7DBMCalYlYTWtT2WLIGTTf2e/H 2yXt86NgbCgBKpWAcBhpCz/svv9SbrdSJ0ZJiOnCqwVhuMSa7hZG7X46X6e5vm8cWdfT 6X64T/LQruLUYmyV/guBtYH8ntVHKepzzuO8Of3KDcjZpmitfJziOn+Fr5xMh7piFhuk omR+1IqwvFX9/DyVzMbkQrkwwgQUW6rCqxjB3BD1GWVrxuaLlMRe34jRu26HvEy64c4F NOTQ== X-Gm-Message-State: AN3rC/46MhOPkuVckIJh0+8Dnojc+Cfm2aQuaaQpGAd9ZEPk8/Kffbgq 3T4wDQAyEv7hcQzU X-Received: by 10.107.137.148 with SMTP id t20mr13778741ioi.79.1493122335585; Tue, 25 Apr 2017 05:12:15 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e90sm1730074itd.30.2017.04.25.05.12.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Apr 2017 05:12:15 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87wpa8yaol.fsf@jane> Date: Tue, 25 Apr 2017 08:13:46 -0400 In-Reply-To: <87wpa8yaol.fsf@jane> (Marcin Borkowski's message of "Tue, 25 Apr 2017 13:43:38 +0200") Message-ID: <87vapsofb9.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Marcin Borkowski writes: >> >> Actually, now that I've applied this thing properly, I notice 2 test >> failures in batch mode: >> >> 2 unexpected results: >> FAILED mark-defun-arg-region-active >> FAILED mark-defun-no-arg-region-active >> >> They pass when run in interactive mode (I haven't looked into why). > > That seems strange - all tests pass here with M-x ert. Yes, same here (that's what I mean by "interactive mode"). > What do you mean by "batch mode"? I mean 'emacs -Q -batch -l .../lisp-tests.el -f ert-run-tests-batch-and-exit' which is what 'make check' or 'cd test && make lisp-tests' do. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Apr 2017 20:50: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149315335614985 (code B ref 21072); Tue, 25 Apr 2017 20:50:02 +0000 Received: (at 21072) by debbugs.gnu.org; 25 Apr 2017 20:49:16 +0000 Received: from localhost ([127.0.0.1]:40158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d37Oe-0003tc-I0 for submit@debbugs.gnu.org; Tue, 25 Apr 2017 16:49:16 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:35723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d37Od-0003tN-7A for 21072@debbugs.gnu.org; Tue, 25 Apr 2017 16:49:15 -0400 Received: by mail-oi0-f48.google.com with SMTP id j201so186680768oih.2 for <21072@debbugs.gnu.org>; Tue, 25 Apr 2017 13:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3E2n6Did/Lci778gfbnlA5fWwDKoRIL7JM56Cz3bkqk=; b=RzIpSBqCP+ctAS9Un8nhU+E/grkxqUifJRhHJFkrpwmJqo1iIwm81bssP4U7wSZIDM qg4ndIpY3/VrsGo22Yj6VCeklavpmrco59SYx252KCuFRCX3xDB9xfM9wA0Z8Ue1gSDe aaaxCowuRQGlQ8G9SIDfDALkLOS8ZXZk57s9lpDlSwcw0Ln7XPllPwZ7N+qxlUVtxam+ D8yyNnEEP5bLMOQ4rFyLGXKHX9jCaLKGm4415USU1RN8zCLMeK+dE1HIYFvpgczItgHz Cdpe9aLgcOz4T02rAccE5XQhqiKoNHVUv1vAv8u2AKfASI/FrgrO6ZsLddNo+GpjhQtz Ir3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3E2n6Did/Lci778gfbnlA5fWwDKoRIL7JM56Cz3bkqk=; b=QQPNtq5cJ8xUlaEIkdwCKKvcyc8KGBLJDwwnmgJS4lQqEdrUCzLm9w4BInTPFIYPAo /a0TSClGIsh6t15TZ+9LQD+elA3mdvbgJ+4J0xnTaNJPwZAuHHruNpAsEH/cadFEHgtW sxRArj8tLQI6dR7HTt4NlbIpnsD5s72Kz/3OP/RSHal4KsaR2S3WcD4+tOu5hEjNHiGq w2WbAcvjsq4cTmbXMBSxbjM4f35iq8vBPx9MMAVl2qLZQXkILgSSDIVQoTOKO4s9jVpk jwoYqW/laegboKhPCsXjUqUDcvF2hZiI1yKjVdNuY5I+naGnHbQ1QqoSvbqLRHrRiDX1 PSYQ== X-Gm-Message-State: AN3rC/57e95n6qwp0spcnGj3axiMTqCrTGmfWbEOjooyWrIiPSkHhZBD uEbncRWHjvdSb+ql6+2GuifVQo81oA== X-Received: by 10.202.56.68 with SMTP id f65mr10965932oia.26.1493153349381; Tue, 25 Apr 2017 13:49:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.25.10 with HTTP; Tue, 25 Apr 2017 13:49:08 -0700 (PDT) In-Reply-To: <87wpa8yaol.fsf@jane> References: <87o9ydrzkr.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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87wpa8yaol.fsf@jane> From: Noam Postavsky Date: Tue, 25 Apr 2017 16:49:08 -0400 X-Google-Sender-Auth: WDmjQe2s_is8WB-XSsmMLQeIzO4 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Tue, Apr 25, 2017 at 7:43 AM, Marcin Borkowski wrote: >> >> Hmm, I was testing before now just by evaluating the changed functions >> after startup, I must have messed something up. I think this one might >> be okay. > > Quick tests show that you are right. I'd like to understand the code, > too - that will take me a while. I started commenting the code a bit which made me think of some more strange corner cases, like /* foo */ foo; function () { return 0; } and I ended up with this (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (let (bobp) (while (let ((ppss (progn (setq bobp (= (forward-line -1) -1)) (syntax-ppss (line-end-position))))) (while (and (nth 4 ppss) ; If eol is in a line-spanning comment, (< (nth 8 ppss) (line-beginning-position))) (goto-char (nth 8 ppss)) ; skip to comment start. (setq ppss (syntax-ppss (line-end-position)))) (and (not bobp) (progn (skip-syntax-backward "-" (line-beginning-position)) (not (bolp))) ; Check for blank line. (progn (parse-partial-sexp (line-beginning-position) (line-end-position) nil t (syntax-ppss (line-beginning-position))) (eolp))))) ; Check for non-comment text. (forward-line (if bobp 0 1)))) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Apr 2017 16:44:01 +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: To: npostavs@users.sourceforge.net Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149331139720675 (code B ref 21072); Thu, 27 Apr 2017 16:44:01 +0000 Received: (at 21072) by debbugs.gnu.org; 27 Apr 2017 16:43:17 +0000 Received: from localhost ([127.0.0.1]:43094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3mVh-0005NO-JY for submit@debbugs.gnu.org; Thu, 27 Apr 2017 12:43:17 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:53913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3mVf-0005NG-So for 21072@debbugs.gnu.org; Thu, 27 Apr 2017 12:43:16 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 5D4DFE62DD; Thu, 27 Apr 2017 18:43:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 gHvTMg3HvlIR; Thu, 27 Apr 2017 18:43:11 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 29E25E6042; Thu, 27 Apr 2017 18:43:10 +0200 (CEST) References: <87o9ydrzkr.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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <8737cyotmt.fsf@users.sourceforge.net> Date: Thu, 27 Apr 2017 18:43:55 +0200 Message-ID: <87h919yf5g.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-24, at 14:52, npostavs@users.sourceforge.net wrote: > Actually, now that I've applied this thing properly, I notice 2 test > failures in batch mode: > > 2 unexpected results: > FAILED mark-defun-arg-region-active > FAILED mark-defun-no-arg-region-active > > They pass when run in interactive mode (I haven't looked into why). Strangely enough, they also fail with my original code. Does anyone have any idea why that might be the case? Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Apr 2017 21: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149332969523493 (code B ref 21072); Thu, 27 Apr 2017 21:49:02 +0000 Received: (at 21072) by debbugs.gnu.org; 27 Apr 2017 21:48:15 +0000 Received: from localhost ([127.0.0.1]:43318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3rGo-00066r-Td for submit@debbugs.gnu.org; Thu, 27 Apr 2017 17:48:15 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:32967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3rGm-00066d-NG for 21072@debbugs.gnu.org; Thu, 27 Apr 2017 17:48:13 -0400 Received: by mail-io0-f170.google.com with SMTP id k87so37547705ioi.0 for <21072@debbugs.gnu.org>; Thu, 27 Apr 2017 14:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+KSs06qTdz/9AWplIVaNLzyUq6ob3bDbLmgL/myhym4=; b=WLPairr8jEwWFvZO/8tesYdvc06tBxnF5GTE33Tzt+CMdzaNeVcOSZwNM/m7e/RP+C QSQ380oa7733anPa28Bf/1Y2B0MuqAxjMzJu+qTNVy+XTDfsu4Y+0vFRXGtFmZP1PsGG phqXNyesRhgIL3UXXlWKvzjaoN3CF7c9jr1eWUx+8z9MqLW4RVn4fmexAijL5m8NZQvp dKlsH/pnw0Bfvtzc0TRaLI7pznLfALrxQVmUSh/ypAwmV4x36vpTzjLw4O+0+P3t7JP0 xlcUNd/+I19SsRD5/sfOMx9hrYYiTWtawdjGQOsCORyckHzZjAF5D0+R/7P3UOGUgcWz jH+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+KSs06qTdz/9AWplIVaNLzyUq6ob3bDbLmgL/myhym4=; b=sp81Xw/wzFl/6m332FW4TtAaEjuudvCAMwCT7FWOKuhyTOvrNnkVONLzK/r2AVax/6 XoXJiQl3DSvuXmKdUp3nmyMg56F70z8yBWR+ODDEJOEMDfsaJB93DTwJ1SuxJ+EhnuXy aWxgX2m0QsvDRNkuMza5NH/v2/aGEhnoCMuvt742VR8EpDFpkKlqIPSjM56A8oJhLukO G4kgBzltGjmVc1wdAINJOsZElC2lGczz9yxiqPXOA+ZQT0r0E9srcwrFk0z/c8UueETX Ry2nXpnbWIgKZ1xeL9kj3mIxJkQNhTMmaf+1+pMwsxEdM+XFRrzc7SVvAE3hWMgvm+9K lRdg== X-Gm-Message-State: AN3rC/5la6TTzjuLWQzIVKcjWdDsaE1oJeAnOMftbVxDC67rPe35eQES yMtP3+j1AMYksCJvs8ni7L9wVrr9AQ== X-Received: by 10.157.33.98 with SMTP id l31mr3769282otd.245.1493329686773; Thu, 27 Apr 2017 14:48:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.25.10 with HTTP; Thu, 27 Apr 2017 14:48:06 -0700 (PDT) In-Reply-To: <87h919yf5g.fsf@jane> References: <87o9ydrzkr.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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> From: Noam Postavsky Date: Thu, 27 Apr 2017 17:48:06 -0400 X-Google-Sender-Auth: s0VrvwqQnY4s82JcIjqkRPG43Gw Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) On Thu, Apr 27, 2017 at 12:43 PM, Marcin Borkowski wrote: > > On 2017-04-24, at 14:52, npostavs@users.sourceforge.net wrote: > >> Actually, now that I've applied this thing properly, I notice 2 test >> failures in batch mode: >> >> 2 unexpected results: >> FAILED mark-defun-arg-region-active >> FAILED mark-defun-no-arg-region-active >> >> They pass when run in interactive mode (I haven't looked into why). > > Strangely enough, they also fail with my original code. Does anyone > have any idea why that might be the case? Oh I see what it is, your test depends on `transient-mark-mode' being enabled. With --batch, that defaults to nil. Should we be testing in both modes or just explicitly set it to t? PS I noticed some problems with elisp-tests-with-temp-buffer while looking at this, I pushed a fix to fix/bug-21072 [1: 04741f0]. 1: 2017-04-27 17:38:09 -0400 04741f02cca95147581e05cb49b54e6dbf8bed56 Fix elisp-tests-with-temp-buffer compilation From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 14:49:01 +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: To: Noam Postavsky Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14935637063827 (code B ref 21072); Sun, 30 Apr 2017 14:49:01 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 14:48:26 +0000 Received: from localhost ([127.0.0.1]:47901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4q9C-0000zf-Fp for submit@debbugs.gnu.org; Sun, 30 Apr 2017 10:48:26 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:49858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4q9B-0000zX-4w for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 10:48:25 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 98BACE62DE; Sun, 30 Apr 2017 16:48:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 xxJoqdEQGjjw; Sun, 30 Apr 2017 16:48:18 +0200 (CEST) Received: from localhost (gra4.internetdsl.tpnet.pl [83.3.182.4]) by mail.mojserwer.eu (Postfix) with ESMTPSA id B83A1E62BF; Sun, 30 Apr 2017 16:48:17 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Sun, 30 Apr 2017 16:49:06 +0200 Message-ID: <874lx6x865.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-27, at 23:48, Noam Postavsky wrote: > On Thu, Apr 27, 2017 at 12:43 PM, Marcin Borkowski wrote: >> >> On 2017-04-24, at 14:52, npostavs@users.sourceforge.net wrote: >> >>> Actually, now that I've applied this thing properly, I notice 2 test >>> failures in batch mode: >>> >>> 2 unexpected results: >>> FAILED mark-defun-arg-region-active >>> FAILED mark-defun-no-arg-region-active >>> >>> They pass when run in interactive mode (I haven't looked into why). >> >> Strangely enough, they also fail with my original code. Does anyone >> have any idea why that might be the case? > > Oh I see what it is, your test depends on `transient-mark-mode' being > enabled. With --batch, that defaults to nil. Should we be testing in > both modes or just explicitly set it to t? Good catch, thanks! I'll set it to t, since this functionality is intended to be used in t-t-m anyway. OTOH, I'm curious where it breaks with that disabled - I'll look into it now, I guess. > PS I noticed some problems with elisp-tests-with-temp-buffer while > looking at this, I pushed a fix to fix/bug-21072 [1: 04741f0]. > > 1: 2017-04-27 17:38:09 -0400 04741f02cca95147581e05cb49b54e6dbf8bed56 > Fix elisp-tests-with-temp-buffer compilation Thanks a lot, I'll take a look! Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 15:19:01 +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: To: Noam Postavsky Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14935655276405 (code B ref 21072); Sun, 30 Apr 2017 15:19:01 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 15:18:47 +0000 Received: from localhost ([127.0.0.1]:47911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4qcZ-0001fF-BX for submit@debbugs.gnu.org; Sun, 30 Apr 2017 11:18:47 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:50983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4qcX-0001f7-Ng for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 11:18:45 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 2E384E62DE; Sun, 30 Apr 2017 17:18:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 7NDA8_b4j1q1; Sun, 30 Apr 2017 17:18:33 +0200 (CEST) Received: from localhost (gra4.internetdsl.tpnet.pl [83.3.182.4]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 768BAE62BF; Sun, 30 Apr 2017 17:18:32 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Sun, 30 Apr 2017 17:19:16 +0200 Message-ID: <8737cpylcb.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-27, at 23:48, Noam Postavsky wrote: > PS I noticed some problems with elisp-tests-with-temp-buffer while > looking at this, I pushed a fix to fix/bug-21072 [1: 04741f0]. > > 1: 2017-04-27 17:38:09 -0400 04741f02cca95147581e05cb49b54e6dbf8bed56 > Fix elisp-tests-with-temp-buffer compilation I started looking at this, and I have a few questions. 1. What is the difference between (debug t) and (debug form body)? From my understanding of the manual, there seems to be none. 2. I still don't fully get the `eval-and-compile' stuff. What exactly happens when the file is compiled? I understand that its forms are not evaluated. But are the _defmacro_ forms evaluated during compilation? If not, what happens when the compiler compiles a function containing a macro invocation? 3. Do I get it correctly that the purpose of the `ignore' calls is to silence the compiler warnings about `let'ting a variable which is then not used in the body of `let'? That's it for now. Sorry if my questions are elementary - I'm still struggling with this compilation stuff... TIA, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 16:11: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Noam Postavsky Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149356865011202 (code B ref 21072); Sun, 30 Apr 2017 16:11:02 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 16:10:50 +0000 Received: from localhost ([127.0.0.1]:47937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4rQw-0002ub-9N for submit@debbugs.gnu.org; Sun, 30 Apr 2017 12:10:50 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:45389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4rQu-0002uO-8D for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 12:10:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BcBgClCwZZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QWisBl1CGHgQCAoQ2RBQBAgEBAQEBAQFrKIUWAQQBViMFCwsOJhIUGA0kiioIsgWLDQEBAQcCJotYikgBBJ1TnXyGc5JpgUQ2IYEKLiAILodQJIlWAQEB X-IPAS-Result: A0BcBgClCwZZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QWisBl1CGHgQCAoQ2RBQBAgEBAQEBAQFrKIUWAQQBViMFCwsOJhIUGA0kiioIsgWLDQEBAQcCJotYikgBBJ1TnXyGc5JpgUQ2IYEKLiAILodQJIlWAQEB X-IronPort-AV: E=Sophos;i="5.37,396,1488862800"; d="scan'208";a="309709114" Received: from 108-161-124-118.dsl.teksavvy.com (HELO ceviche.home) ([108.161.124.118]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Apr 2017 12:10:42 -0400 Received: by ceviche.home (Postfix, from userid 20848) id BF9F7662C5; Sun, 30 Apr 2017 12:10:36 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> Date: Sun, 30 Apr 2017 12:10:36 -0400 In-Reply-To: <8737cpylcb.fsf@jane> (Marcin Borkowski's message of "Sun, 30 Apr 2017 17:19:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 1. What is the difference between (debug t) and (debug form body)? From > my understanding of the manual, there seems to be none. Indeed, no significant difference. > 2. I still don't fully get the `eval-and-compile' stuff. What exactly > happens when the file is compiled? During compilation, (eval-and-compile E) will be treated (i.e. compiled) just like E, except that E is evaluated along the way (so the definitions present in E are available during compilation). > I understand that its forms are not evaluated. They are. It's for `eval-when-compile` that they aren't. > But are the _defmacro_ forms evaluated during compilation? The defmacro forms are always evaluated (and byte-compiled) during compilation (as if they were implicitly wrapped inside an eval-and-compile). > 3. Do I get it correctly that the purpose of the `ignore' calls is to > silence the compiler warnings about `let'ting a variable which is then > not used in the body of `let'? Yes. Stfean From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 18:06: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: To: Stefan Monnier Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149357550621412 (code B ref 21072); Sun, 30 Apr 2017 18:06:02 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 18:05:06 +0000 Received: from localhost ([127.0.0.1]:47998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4tDW-0005ZI-7L for submit@debbugs.gnu.org; Sun, 30 Apr 2017 14:05:06 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:36386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4tDU-0005Yk-RP for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 14:05:05 -0400 Received: by mail-io0-f171.google.com with SMTP id p80so95951552iop.3 for <21072@debbugs.gnu.org>; Sun, 30 Apr 2017 11:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=sTVlqzmVxPAA+aj7vHlhB36jy8K+hl9cPSwpu0gCop4=; b=ZuMAoLsMg3BiIYQrXcFeASWShtelJnXzFahm+3SEWlyTO4sFPNZPwMywTF8o9uxfeL pJBbZT15PK9NboQMkdi0wk7Trt/6wMVMNflrxYdRsRebFCpNziGEkb5QFMhWQZ7NLj3P RXsAy1IQqBzc271Y8KSxus5pHvbfxThV6BbvHIucDv6QPh34K0H6a3pWa/q7mOZtUGaN Ga7l5uJxs6NilsdmRy7AbLfMr8mpYZZBQhCF9gvaSgyNe3ixZfjAobGYd2fcKhGHRqwI QhA9vqqwpSvNNqvXDdQOdQChhCgmA2J/lzo9tmF+3b5NHuhNRlAsPXg8jxLpxyS578So 4Xzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=sTVlqzmVxPAA+aj7vHlhB36jy8K+hl9cPSwpu0gCop4=; b=tWszd/wTd2pggZKyLRO7Bwvn2v+n6WRb9nm3cH/0L9nx9HKjDlfhcz1h28nVEsrBOn n83cFmB5r43ayzB46/mnJF+Jn0XEwqW69jz9Bs7V6UEw5MysPqW1qXGiTzbRuGtgq7e9 YhxjASmgksyuJ0GVNm4hOq/tYb65A/z2vPeP9LmE9Xbis84KqkY0Fuy2e+FPhifZRvmJ rlrMZBpw3+VmJ9aFNhqZEN3v4TaDHXudGdohcjctAR3EK3R6zWj7Fm+KKrto2PCwKuTv 2ziu51cu7Xh5thpkdsjKz697kDR5En5SVorka2sEJ1cRAty8ULaB7cQ+Bqow2RswKjCD cOsw== X-Gm-Message-State: AN3rC/71JqYSe0wSwyBa+S81wjpbhAb1ysumIJFJL0KQOat7rbmDza5Y nr0r7hSTN7GAzlZKQnmf1Qi7FpZEYA== X-Received: by 10.157.63.143 with SMTP id r15mr8424740otc.89.1493575499217; Sun, 30 Apr 2017 11:04:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.25.10 with HTTP; Sun, 30 Apr 2017 11:04:58 -0700 (PDT) In-Reply-To: References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> From: Noam Postavsky Date: Sun, 30 Apr 2017 14:04:58 -0400 X-Google-Sender-Auth: 98llWvTNYCc8TVyZiFh402FBpaQ Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) On Sun, Apr 30, 2017 at 12:10 PM, Stefan Monnier wrote: >> 1. What is the difference between (debug t) and (debug form body)? From >> my understanding of the manual, there seems to be none. > > Indeed, no significant difference. Oops, I meant (debug sexp body), then I changed it for some reason and forgot to change back to the correct thing. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 18:47:01 +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: To: Noam Postavsky Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149357799225037 (code B ref 21072); Sun, 30 Apr 2017 18:47:01 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 18:46:32 +0000 Received: from localhost ([127.0.0.1]:48031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4trc-0006Vl-Lc for submit@debbugs.gnu.org; Sun, 30 Apr 2017 14:46:32 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:55049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4tra-0006VY-7D for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 14:46:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BcBgAmMAZZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QWisBl1CGHgQCAoQ2RBQBAgEBAQEBAQFrKIUWAQQBViMQCw4mEhQYDSSKKgixQIsNAQEBBwImi1iKSAEEnVOUe4kBhnOSaYFENiGBCi4gCC6HUCSJVgEBAQ X-IPAS-Result: A0BcBgAmMAZZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QWisBl1CGHgQCAoQ2RBQBAgEBAQEBAQFrKIUWAQQBViMQCw4mEhQYDSSKKgixQIsNAQEBBwImi1iKSAEEnVOUe4kBhnOSaYFENiGBCi4gCC6HUCSJVgEBAQ X-IronPort-AV: E=Sophos;i="5.37,396,1488862800"; d="scan'208";a="309714557" Received: from 108-161-124-118.dsl.teksavvy.com (HELO ceviche.home) ([108.161.124.118]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Apr 2017 14:46:24 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 823DB662C5; Sun, 30 Apr 2017 14:46:23 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> Date: Sun, 30 Apr 2017 14:46:23 -0400 In-Reply-To: (Noam Postavsky's message of "Sun, 30 Apr 2017 14:04:58 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >>> 1. What is the difference between (debug t) and (debug form body)? From >>> my understanding of the manual, there seems to be none. >> Indeed, no significant difference. > Oops, I meant (debug sexp body), then I changed it for some reason and > forgot to change back to the correct thing. Ah that changes everything: (debug (sexp body)) is quite different from (debug t) since it says that the first argument is not an expression (and hence shouldn't be instrumented). Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 19:17: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: To: Stefan Monnier Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14935798082125 (code B ref 21072); Sun, 30 Apr 2017 19:17:02 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 19:16:48 +0000 Received: from localhost ([127.0.0.1]:48059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4uKu-0000YD-5Q for submit@debbugs.gnu.org; Sun, 30 Apr 2017 15:16:48 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:34159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4uKs-0000Xy-QJ for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 15:16:47 -0400 Received: by mail-it0-f67.google.com with SMTP id c26so10697111itd.1 for <21072@debbugs.gnu.org>; Sun, 30 Apr 2017 12:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=nIG9+Ed8vDX22YPVEXOCAPhRzQyfoZqTT17pot7leVg=; b=lDAuL2aa8cgE6ZnhpDMNYbHKR6PC9qSRAVctfK1t6qlfeYnhMOuAqs6nSYzQS8+dlA GnJD0hLSYS4kXWo/dTsYatZm02RgDFG3u2qHbgHdW+1Tqdh+CuptjB/VSbWL6Lh57HAx 4zrHuIpxnIIRT6va2BQk3eQouPCZ3trm61wwnpJ95xoMoJW8zZTrtm7ZlTOUlS1GUDkv h7edMrI3kmMMiZvfifILJfUAozId2IL+HWnHZHSiRxj5tCDYi+Duq5gqaOghNaPMZ493 6AyIZ7fYnrkgW7kBEHDE9cMtDoXdlpb4pCuCmUjOJ3Ii722oX91X14R2bNBECHhTQoNo 4P9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=nIG9+Ed8vDX22YPVEXOCAPhRzQyfoZqTT17pot7leVg=; b=hdtr1SP+Ki1DQJpco+f+8QBLWrbnE7lJhCqzjWvbY4TMIOWBjM/fWZaNu3X/H7dyM4 5CSymy/E0438AfrD/uWx4hbLbWduSCMNi9oh5dZGkaBfwMLbSgxz8SPL5Vctsr48d6TL ecQrPUKH8LQXIfAz2F20p93Ma4Td34JM3wbiiR0vF/pI1EEqZhPC3tQuAIeUe2spZ6Xd LxYW653KiqiQmGKUm7PIusar4Klhukmaech6ln0tHAbduxjieFsL9doX+qaLFORE5MWD wfC1IjyU+lYtCVdePMFdK15vS+gNWZ3KqQQ4FqGYIKidXDEQKSoBdNuN/xMEFFw5AT2h K9Lg== X-Gm-Message-State: AN3rC/5KQJ0xLOrH4k0GoNa3q7LGScz/TAwbN5SIRCFhIMssmB/CDnj4 PrMQeBkNkPo11gMt X-Received: by 10.36.118.75 with SMTP id z72mr18430236itb.33.1493579800997; Sun, 30 Apr 2017 12:16:40 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id n85sm5395118ioi.6.2017.04.30.12.16.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Apr 2017 12:16:40 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> Date: Sun, 30 Apr 2017 15:18:11 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 30 Apr 2017 14:46:23 -0400") Message-ID: <878tmhogb0.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Stefan Monnier writes: >>>> 1. What is the difference between (debug t) and (debug form body)? From >>>> my understanding of the manual, there seems to be none. >>> Indeed, no significant difference. >> Oops, I meant (debug sexp body), then I changed it for some reason and >> forgot to change back to the correct thing. > > Ah that changes everything: (debug (sexp body)) is quite different from > (debug t) since it says that the first argument is not an expression > (and hence shouldn't be instrumented). I guess it's related to the fact that the first argument is evaluated by the macro itself at compile time, with (debug t) or (debug form body) I get an error when trying to instrument one of tests using that macro: Debugger entered--Lisp error: (wrong-type-argument char-or-string-p (edebug-after 0 3 mark-defun-test-buffer)) insert((edebug-after 0 3 mark-defun-test-buffer)) (progn (insert (cond ((symbolp contents) (symbol-value contents)) (t contents))) (goto-char (point-min)) [...]) (unwind-protect [...] (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) [...]) (let ((temp-buffer (generate-new-buffer " *temp*"))) [...]) (let* ((var-pos nil) (text (let ((temp-buffer (generate-new-buffer " *temp*"))) [...]))) [...]) (closure (t) (contents &rest body) "Create an `emacs-lisp-mode' enabled temp buffer with CONTENTS[...] macroexpand((elisp-tests-with-temp-buffer [...] [...] edebug-eval-defun((4)) apply(edebug-eval-defun (4)) eval-defun((4)) funcall-interactively(eval-defun (4)) call-interactively(eval-defun nil nil) command-execute(eval-defun) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 20:10:01 +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: To: npostavs@users.sourceforge.net Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14935829546954 (code B ref 21072); Sun, 30 Apr 2017 20:10:01 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 20:09:14 +0000 Received: from localhost ([127.0.0.1]:48112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4v9e-0001o6-Ef for submit@debbugs.gnu.org; Sun, 30 Apr 2017 16:09:14 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:21593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4v9c-0001nt-HU for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 16:09:13 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BZBgD1QwZZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QWisBl1CGHgQCAoQ2QxUBAgEBAQEBAQFrKIUWAQQBViMFCws0EhQYDYpOCLExiw0BAQEHAiaLJDSFL4UZBZARjUKdfIZzkmmBRDUigQouIAguh1AkiVYBAQE X-IPAS-Result: A0BZBgD1QwZZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QWisBl1CGHgQCAoQ2QxUBAgEBAQEBAQFrKIUWAQQBViMFCws0EhQYDYpOCLExiw0BAQEHAiaLJDSFL4UZBZARjUKdfIZzkmmBRDUigQouIAguh1AkiVYBAQE X-IronPort-AV: E=Sophos;i="5.37,396,1488862800"; d="scan'208";a="309717407" Received: from 108-161-124-118.dsl.teksavvy.com (HELO pastel.home) ([108.161.124.118]) by smtp.teksavvy.com with ESMTP; 30 Apr 2017 16:09:05 -0400 Received: by pastel.home (Postfix, from userid 20848) id E1A1E6286D; Sun, 30 Apr 2017 16:09:05 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <878tmhogb0.fsf@users.sourceforge.net> Date: Sun, 30 Apr 2017 16:09:05 -0400 In-Reply-To: <878tmhogb0.fsf@users.sourceforge.net> (npostavs's message of "Sun, 30 Apr 2017 15:18:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I guess it's related to the fact that the first argument is evaluated by > the macro itself at compile time, with (debug t) or (debug form body) I > get an error when trying to instrument one of tests using that macro: Yes, you can either use (debug (sexp body)) to avoid instrumenting the first arg, or you might use (debug (def-form body)) so as to warn that the first argument is not evaluated at the "normal" time. Stefan > Debugger entered--Lisp error: (wrong-type-argument char-or-string-p > (edebug-after 0 3 mark-defun-test-buffer)) > insert((edebug-after 0 3 mark-defun-test-buffer)) > (progn (insert (cond ((symbolp contents) (symbol-value contents)) (t > contents))) (goto-char (point-min)) [...]) > (unwind-protect [...] (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) > (save-current-buffer (set-buffer temp-buffer) [...]) > (let ((temp-buffer (generate-new-buffer " *temp*"))) [...]) > (let* ((var-pos nil) (text (let ((temp-buffer (generate-new-buffer " *temp*"))) [...]))) [...]) > (closure (t) (contents &rest body) "Create an `emacs-lisp-mode' enabled > temp buffer with CONTENTS[...] > macroexpand((elisp-tests-with-temp-buffer [...] > [...] > edebug-eval-defun((4)) > apply(edebug-eval-defun (4)) > eval-defun((4)) > funcall-interactively(eval-defun (4)) > call-interactively(eval-defun nil nil) > command-execute(eval-defun) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 21:40:01 +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: To: Stefan Monnier Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149358838415063 (code B ref 21072); Sun, 30 Apr 2017 21:40:01 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 21:39:44 +0000 Received: from localhost ([127.0.0.1]:48152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4wZE-0003ut-IJ for submit@debbugs.gnu.org; Sun, 30 Apr 2017 17:39:44 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:33744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4wZC-0003ue-IZ for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 17:39:43 -0400 Received: by mail-it0-f66.google.com with SMTP id z67so10895901itb.0 for <21072@debbugs.gnu.org>; Sun, 30 Apr 2017 14:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=YE0Ziew8LQsAZt861MewLmyIY5cc+fW6qjnf0XCD1bg=; b=i88hgrowg6ldCOGE88YAZOT/cj5c1yNx918FwcabjfmaDHArXQG7cFHqtydfBvzAm3 TbACoHNXj/hNiqQ2ZXElH7fazzqsBTLVXrmeXVm2CVkTnIKiONR2A5reJugqeI0clisq 86BZHn4GTdDkNNwhJqstMTCPWp1i1M0Mzv25oJo1o01kI+Sq1po76Ft/5LRZ0G0TfVxL LBoEifT1pBB6KUVhiMrKdOU95UVs7vepa9R0iAkkcVkKxCa/HiEfQYpxw+tUzqDcDbTT z0Jo73oUmNhvPJpoQ4wpcLcfHIyQv+V/0nGmjZBtGuUZQ1TWCeeecy9Iqncs4JXWac3h 1vZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=YE0Ziew8LQsAZt861MewLmyIY5cc+fW6qjnf0XCD1bg=; b=I0/Q+vjhcaEnGqjwKh3Shuwtjw74B/AsRS6pBBbB7kXIVenUAX5Nzxbbn0cYPe7vdW 5KYKQ9nvt6lywUUjWLpZpJ5iKgvh9AHSxMgLn2meQX8ABi9jWwKQSL8yt11VQWFCoLZz c3f47dQl24Yn7s2iWvu7v7FQkz2+zYHZosLGDWEuBh2CnRGOLYf4oemT5nlTfxCnzUZ6 6B/pXicO3nwButWdMEKV2C0gp8REgeC0GBrHROvyd1W0g9jn5dBFtXxlrUS4sdUxCa6B Ci+N0ygyna+MJ8qIcH6pYvnhOJua1RXHwPsUWmx6ty7nEa4jJB3snvYFJXl3hhIbWl4+ 4NPg== X-Gm-Message-State: AN3rC/5nQ+KxWtRIUDYY13+wHJCGuHq9HFM5PzVBwREYJBKo/3Ecbp2s 7NQKMdPfALA5lw== X-Received: by 10.36.117.140 with SMTP id y134mr18654626itc.53.1493588376855; Sun, 30 Apr 2017 14:39:36 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id z85sm3059424ita.3.2017.04.30.14.39.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Apr 2017 14:39:36 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <878tmhogb0.fsf@users.sourceforge.net> Date: Sun, 30 Apr 2017 17:41:07 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 30 Apr 2017 16:09:05 -0400") Message-ID: <8760hlo9os.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Stefan Monnier writes: >> I guess it's related to the fact that the first argument is evaluated by >> the macro itself at compile time, with (debug t) or (debug form body) I >> get an error when trying to instrument one of tests using that macro: > > Yes, you can either use (debug (sexp body)) to avoid instrumenting the > first arg, or you might use (debug (def-form body)) so as to warn that > the first argument is not evaluated at the "normal" time. I'm not sure exactly what def-form means, but using it gives a similar error. Debugger entered--Lisp error: (wrong-type-argument char-or-string-p (edebug-enter (quote test@mark-defun-no-arg-region-inactive) nil (function (lambda nil (edebug-after 0 3 mark-defun-test-buffer))))) insert((edebug-enter (quote test@mark-defun-no-arg-region-inactive) nil (function (lambda nil (edebug-after 0 3 mark-defun-test-buffer))))) [...] From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 22:05: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: To: npostavs@users.sourceforge.net Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149358984617366 (code B ref 21072); Sun, 30 Apr 2017 22:05:02 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 22:04:06 +0000 Received: from localhost ([127.0.0.1]:48184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4wwn-0004W2-N7 for submit@debbugs.gnu.org; Sun, 30 Apr 2017 18:04:05 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:45388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4wwk-0004VX-PD for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 18:04:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BoBgDRXgZZ/3Z8oWxdGgEBAQECAQEBAQgBAQEBg1WKYoV/kForAZdQhh4EAgKENkQUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA2KTgixDosNAQEBBwImi1iFL4UZBZ1TnXyGc5JpgUQ2IYEKLiAILodQJIlWAQEB X-IPAS-Result: A0BoBgDRXgZZ/3Z8oWxdGgEBAQECAQEBAQgBAQEBg1WKYoV/kForAZdQhh4EAgKENkQUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA2KTgixDosNAQEBBwImi1iFL4UZBZ1TnXyGc5JpgUQ2IYEKLiAILodQJIlWAQEB X-IronPort-AV: E=Sophos;i="5.37,397,1488862800"; d="scan'208";a="309721886" Received: from 108-161-124-118.dsl.teksavvy.com (HELO pastel.home) ([108.161.124.118]) by smtp.teksavvy.com with ESMTP; 30 Apr 2017 18:03:37 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9AC716286D; Sun, 30 Apr 2017 18:03:37 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <87o9wkoald.fsf@jane> <87a881ofsu.fsf@jane> <87k272wh8x.fsf@users.sourceforge.net> <871st4aal7.fsf@jane> <87tw5l7v26.fsf@jane> <877f2hs1nw.fsf@users.sourceforge.net> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <878tmhogb0.fsf@users.sourceforge.net> <8760hlo9os.fsf@users.sourceforge.net> Date: Sun, 30 Apr 2017 18:03:37 -0400 In-Reply-To: <8760hlo9os.fsf@users.sourceforge.net> (npostavs's message of "Sun, 30 Apr 2017 17:41:07 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >>> I guess it's related to the fact that the first argument is evaluated by >>> the macro itself at compile time, with (debug t) or (debug form body) I >>> get an error when trying to instrument one of tests using that macro: >> >> Yes, you can either use (debug (sexp body)) to avoid instrumenting the >> first arg, or you might use (debug (def-form body)) so as to warn that >> the first argument is not evaluated at the "normal" time. > I'm not sure exactly what def-form means, but using it gives a similar > error. > Debugger entered--Lisp error: (wrong-type-argument char-or-string-p > (edebug-enter (quote test@mark-defun-no-arg-region-inactive) nil (function > (lambda nil (edebug-after 0 3 mark-defun-test-buffer))))) > insert((edebug-enter (quote test@mark-defun-no-arg-region-inactive) nil > (function (lambda nil (edebug-after 0 3 mark-defun-test-buffer))))) > [...] This suggests that the first arg is not "evaluated by the macro itself at compile time", but instead is passed unevaluated to `insert`, in which case it can't be instrumented. Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2017 22:21: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: To: Stefan Monnier Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149359083118910 (code B ref 21072); Sun, 30 Apr 2017 22:21:02 +0000 Received: (at 21072) by debbugs.gnu.org; 30 Apr 2017 22:20:31 +0000 Received: from localhost ([127.0.0.1]:48200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4xCh-0004uw-6B for submit@debbugs.gnu.org; Sun, 30 Apr 2017 18:20:31 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:36151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d4xCf-0004uk-LV for 21072@debbugs.gnu.org; Sun, 30 Apr 2017 18:20:30 -0400 Received: by mail-io0-f194.google.com with SMTP id x86so18752106ioe.3 for <21072@debbugs.gnu.org>; Sun, 30 Apr 2017 15:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Dms0zdNNum5nVurYFKqRqBVfaxFFpPhnBdpFQnVUv88=; b=pO1tH8sqp71LCTZEh3ZHnLQtHTwml88IG29FfNmxXa+wc8qjzFlZAhcQ/cDx/ZOiSM IhnzWbsAvN3vF53f91DQcobOXTxPXFzp91Ovl3U232sSvA13qTecbkuqCk68c9IjGP7L d2ajEFb+A9LhIOuY6Ya6sxWycVP7ICGLvQnR/u38soDvbpqB2obhSOgBnU0UUgRYKQaS NakyoCAY5vnV6Sg5dMFwUmWgUivCQS+z1rOZglSAXnQaPVtAIzGsM0MtMdpyfVhPOCLc 8HztoS7X4XmZfON2/BccOFenxRAX768zbogqh6N0fYVbxu/RdlNAy4ss/pzhP17u0Q5/ DYKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Dms0zdNNum5nVurYFKqRqBVfaxFFpPhnBdpFQnVUv88=; b=h7GEjExf9TKEtY95+goq6Kf8z8ZTQWai5CJBjryPw1tEys2kIFUCDENVmdD4PI8/Jj I9Jac5NH/r+54tH9E5l53Idv+JEpbJTxgFabbxTSt+Ped41i4OJCQz59Lu0hcwPho8Dy kfEbl64Y8avn0Mf6kAW4penIJMjuv1fpgY+zZVeeue3VWuIAfiESAYYvxeuMw760MDj+ 6CNaMrx66LQI69yBeS+0IEWD85AZfr/XTlYLcnQeBhcbt1Ekgex7bUdy3VPHfEhtpYdY 50+T6pcXHaRUGZtZS8nZrTeqBfLjcgVeYaqif3FxtYhaHosABHreccolxKZGL2tL00FW dn2w== X-Gm-Message-State: AN3rC/5UEvYvtg5xDyOiBiD6/uF4Jj1uXbxEDTm0Y90HKGvy0kNmgPd0 nUov/PG9tEKhJw== X-Received: by 10.107.9.37 with SMTP id j37mr20404747ioi.43.1493590824120; Sun, 30 Apr 2017 15:20:24 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id z85sm3111389ita.3.2017.04.30.15.20.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Apr 2017 15:20:23 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <87a881ofsu.fsf@jane> <87k272wh8x.fsf@users.sourceforge.net> <871st4aal7.fsf@jane> <87tw5l7v26.fsf@jane> <877f2hs1nw.fsf@users.sourceforge.net> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <878tmhogb0.fsf@users.sourceforge.net> <8760hlo9os.fsf@users.sourceforge.net> Date: Sun, 30 Apr 2017 18:21:54 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 30 Apr 2017 18:03:37 -0400") Message-ID: <8737cpo7st.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Stefan Monnier writes: > This suggests that the first arg is not "evaluated by the macro itself > at compile time", but instead is passed unevaluated to `insert`, in > which case it can't be instrumented. Oh, I see, this patch works, although it surprised me a bit to start stepping immediately when doing the C-u C-M-x. --- i/test/lisp/emacs-lisp/lisp-tests.el +++ w/test/lisp/emacs-lisp/lisp-tests.el @@ -320,12 +320,10 @@ elisp-tests-with-temp-buffer of the form =!NAME= in CONTENTS are removed, and a for each one a variable called NAME is bound to the position of the word's start." - (declare (indent 1) (debug (form body))) + (declare (indent 1) (debug (def-form body))) (let* ((var-pos nil) (text (with-temp-buffer - (insert (cond ((symbolp contents) - (symbol-value contents)) - (t contents))) + (insert (eval contents)) (goto-char (point-min)) (while (re-search-forward elisp-test-point-position-regex nil t) (push (list (intern (match-string-no-properties 1)) From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2017 05:27: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: To: Stefan Monnier Cc: 21072@debbugs.gnu.org, Noam Postavsky Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14937892003938 (code B ref 21072); Wed, 03 May 2017 05:27:02 +0000 Received: (at 21072) by debbugs.gnu.org; 3 May 2017 05:26:40 +0000 Received: from localhost ([127.0.0.1]:51808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5moB-00011S-Ur for submit@debbugs.gnu.org; Wed, 03 May 2017 01:26:40 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:53429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5moA-00011K-8Z for 21072@debbugs.gnu.org; Wed, 03 May 2017 01:26:38 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id E1851E65E7; Wed, 3 May 2017 07:26:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 PIae_IraQXnu; Wed, 3 May 2017 07:26:34 +0200 (CEST) Received: from localhost (gra4.internetdsl.tpnet.pl [83.3.182.4]) by mail.mojserwer.eu (Postfix) with ESMTPSA id E0BB5E6585; Wed, 3 May 2017 07:26:33 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Wed, 03 May 2017 07:27:20 +0200 Message-ID: <87vapiwlvr.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-04-30, at 18:10, Stefan Monnier wrote: >> 2. I still don't fully get the `eval-and-compile' stuff. What exactly >> happens when the file is compiled? > > During compilation, (eval-and-compile E) will be treated (i.e. compiled) > just like E, except that E is evaluated along the way (so the > definitions present in E are available during compilation). > >> I understand that its forms are not evaluated. > > They are. It's for `eval-when-compile` that they aren't. Thanks for your answer, but I'm still not sure. Are the tables below right? Running: | form | evaled? | compiled? | |---------------------------------+---------+-----------| | (defun ...) | yes | no | | (eval-when-compile (defun ...)) | no | no | | (eval-and-compile (defun ...)) | yes | no | | (defmacro ...) | yes | no | Compilation: | form | evaled? | compiled? | |---------------------------------+---------+-----------| | (defun ...) | no | yes | | (eval-when-compile (defun ...)) | yes | yes | | (eval-and-compile (defun ...)) | yes | yes | | (defmacro ...) | yes | yes | TIA, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2017 08:44:01 +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: To: Marcin Borkowski Cc: Noam Postavsky , Stefan Monnier , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149380101621333 (code B ref 21072); Wed, 03 May 2017 08:44:01 +0000 Received: (at 21072) by debbugs.gnu.org; 3 May 2017 08:43:36 +0000 Received: from localhost ([127.0.0.1]:51893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5psl-0005Y1-Qu for submit@debbugs.gnu.org; Wed, 03 May 2017 04:43:35 -0400 Received: from mout.web.de ([217.72.192.78]:51269) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5psk-0005Xo-Ji for 21072@debbugs.gnu.org; Wed, 03 May 2017 04:43:35 -0400 Received: from drachen.dragon ([188.99.165.50]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Mgwhg-1dRszo1F8i-00M4L0; Wed, 03 May 2017 10:43:04 +0200 From: Michael Heerdegen References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <87vapiwlvr.fsf@jane> Date: Wed, 03 May 2017 10:43:01 +0200 In-Reply-To: <87vapiwlvr.fsf@jane> (Marcin Borkowski's message of "Wed, 03 May 2017 07:27:20 +0200") Message-ID: <87wp9ynxey.fsf@drachen> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:t8GzSF+qAKV9ZnXqFbVaruc3ZCNGvNc+rMuuIyi5I1oPPzxXm/J aLIUOixpJzh4zRuaV/zoIRXXv+TocuNTdvuujJxf0sar9NEM0IKG8CC8oeCRBN3akd7uQdq gUrpQ0HyT3mJi3o6mqzYtKJQidKWCZ4G3l9hLVcJGzWEqMNWci1f5a2aUoeKlb3Yi/3Hfbn aHEsZ+uoGobRkeUf7VMsg== X-UI-Out-Filterresults: notjunk:1;V01:K0:9/S3JWms2WE=:KOMUFC+lAm6n0fUhKnArJW pq4I92JQIvMck566YHhEXCPoqAC4/jIJ5RdjLKp4o8u7nxoVOMJb5YXEijjudEfDbLFH+qMV/ k44cQZzku/ADk7aplqeoot4WGaxfRlaTfPMJrtveS2TNyHl9ggntHcJSzqJd8Jl4k1J3M/BEv 69ZuH51fRCsK9HLyI/h7JR2vfCz/IVBDWD8JT9B033HSLwXJLrOPy7KJRyP4dQluw86X9oAWX fkiBUFXSgw+4UvSIwXy+0BJmOCl408/i6WwP5NhTmZTvPiy+1UHbzDbaVwJmgFkTzMOG79vkb Ku5Axt1qdBBJ7hhBZj9FKV7F3zn6GUy2WIBcWEe1v0iwIUVywjmAMIR+mcb/elq6qSQn2+qcg JCkn4fG6zfu/DTdl1EuNoe46r89CRPdR5oPxNJe/JDTpCEy2cQWmnTz7zMjtedpooqvpFd2Os r+8Wr53Y/4REJXMBhK6lzKHxW51rYw/EoEcuTqANMFYFkmqAK8Z/MfudpeoE2lQ534JvuRR5C CdaN1gWqQpVnzrumGu5uS74gjSCGsppBDdPk9dqCZt+BgVBRdxO3EaDv+C6i6oTsB2ClgLwq0 2H6AqJc5MCBqiJihDIGpqbI3YfLWQR95chzTtj+bPjipn3HruFw4P/3XIu5nWk46FDcebYlck eUhIKosmxrqwI2/Bc35zCr7RmFUTuwuvJytrM5UR0d87sNa/fpaBYR/k8JgYsRfyUK652zH3C O1Kd1fCxfhVG/+GmCvlEtpZorL7LVbcUhovR8XMBXxyPqLJW3xv2lpma+Y1pPbpAe7uV951x5 rYvaYNT X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) Marcin Borkowski writes: > Thanks for your answer, but I'm still not sure. Are the tables below > right? > > Running: > > | form | evaled? | compiled? | > |---------------------------------+---------+-----------| > | (defun ...) | yes | no | > | (eval-when-compile (defun ...)) | no | no | > | (eval-and-compile (defun ...)) | yes | no | > | (defmacro ...) | yes | no | I find this table very confusing. Does the second column really mean "Is the form evaluated when it is compiled when it is not compiled"? I suggest to have a look at the definitions. AFAICT the semantics of `eval-when-compile' and `eval-and-compile' are defined by (1) their regular definitions in byte-run.el and (2) the specifications in the definition of `byte-compile-initial-macro-environment'. Even if you don't know much details, it all should be human readable. Regards, Michael. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2017 12:46:01 +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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Noam Postavsky Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149381552323815 (code B ref 21072); Wed, 03 May 2017 12:46:01 +0000 Received: (at 21072) by debbugs.gnu.org; 3 May 2017 12:45:23 +0000 Received: from localhost ([127.0.0.1]:52053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5tel-0006C3-BQ for submit@debbugs.gnu.org; Wed, 03 May 2017 08:45:23 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5tej-0006Bq-Po for 21072@debbugs.gnu.org; Wed, 03 May 2017 08:45:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A5EQBszwlZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QYCsBlUOCDoYeBAIChD1HEQECAQEBAQEBAWsohRYBBAFWIwULCw4mEhQYDSSKLAizC4pxAQEBBwImi1iKSAEEiUCUG5R+iQGGc5JwgUQ4AR6BCi4gCC6HUSSJFAEBAQ X-IPAS-Result: A0A5EQBszwlZ/3Z8oWxcGgEBAQECAQEBAQgBAQEBg1WFCIVahX+QYCsBlUOCDoYeBAIChD1HEQECAQEBAQEBAWsohRYBBAFWIwULCw4mEhQYDSSKLAizC4pxAQEBBwImi1iKSAEEiUCUG5R+iQGGc5JwgUQ4AR6BCi4gCC6HUSSJFAEBAQ X-IronPort-AV: E=Sophos;i="5.38,284,1491278400"; d="scan'208";a="309954349" Received: from 108-161-124-118.dsl.teksavvy.com (HELO ceviche.home) ([108.161.124.118]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 May 2017 08:44:52 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 060F3662E0; Wed, 3 May 2017 08:44:52 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <87vapiwlvr.fsf@jane> Date: Wed, 03 May 2017 08:44:51 -0400 In-Reply-To: <87vapiwlvr.fsf@jane> (Marcin Borkowski's message of "Wed, 03 May 2017 07:27:20 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Running: I assume you mean "without compilation" (i.e. using only the .el file). > | form | evaled? | compiled? | > |---------------------------------+---------+-----------| > | (defun ...) | yes | no | > | (eval-when-compile (defun ...)) | no | no | ^^ yes > Compilation: And > | form | evaled? | compiled? | > |---------------------------------+---------+-----------| > | (defun ...) | no | yes | > | (eval-when-compile (defun ...)) | yes | yes | ^^^ no Instead, the whole expression is compiled as a constant holding the value returned from the evaluation. Hence this can be used for things like (eval-when-compile (+ 3 4)). Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2017 15:21:01 +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: To: npostavs@users.sourceforge.net Cc: Stefan Monnier , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14938248246461 (code B ref 21072); Wed, 03 May 2017 15:21:01 +0000 Received: (at 21072) by debbugs.gnu.org; 3 May 2017 15:20:24 +0000 Received: from localhost ([127.0.0.1]:52963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5w4l-0001g9-Tf for submit@debbugs.gnu.org; Wed, 03 May 2017 11:20:24 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:51211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5w4j-0001g0-SS for 21072@debbugs.gnu.org; Wed, 03 May 2017 11:20:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 95258E661F; Wed, 3 May 2017 17:20:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 YLMUhYmGsKD5; Wed, 3 May 2017 17:20:09 +0200 (CEST) Received: from localhost (apn-31-0-23-9.dynamic.gprs.plus.pl [31.0.23.9]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 7B32CE6585; Wed, 3 May 2017 17:20:09 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <87k272wh8x.fsf@users.sourceforge.net> <871st4aal7.fsf@jane> <87tw5l7v26.fsf@jane> <877f2hs1nw.fsf@users.sourceforge.net> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <8737cpylcb.fsf@jane> <878tmhogb0.fsf@users.sourceforge.net> <8760hlo9os.fsf@users.sourceforge.net> <8737cpo7st.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <8737cpo7st.fsf@users.sourceforge.net> Date: Wed, 03 May 2017 17:20:56 +0200 Message-ID: <87shkmvuef.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-05-01, at 00:21, npostavs@users.sourceforge.net wrote: > Stefan Monnier writes: > >> This suggests that the first arg is not "evaluated by the macro itself >> at compile time", but instead is passed unevaluated to `insert`, in >> which case it can't be instrumented. > > Oh, I see, this patch works, although it surprised me a bit to start > stepping immediately when doing the C-u C-M-x. > > --- i/test/lisp/emacs-lisp/lisp-tests.el > +++ w/test/lisp/emacs-lisp/lisp-tests.el > @@ -320,12 +320,10 @@ elisp-tests-with-temp-buffer > of the form =!NAME= in CONTENTS are removed, and a for each one a > variable called NAME is bound to the position of the word's > start." > - (declare (indent 1) (debug (form body))) > + (declare (indent 1) (debug (def-form body))) > (let* ((var-pos nil) > (text (with-temp-buffer > - (insert (cond ((symbolp contents) > - (symbol-value contents)) > - (t contents))) > + (insert (eval contents)) > (goto-char (point-min)) > (while (re-search-forward elisp-test-point-position-regex nil t) > (push (list (intern (match-string-no-properties 1)) Hi Stefan and Noam, I finally analyzed Noam's code, and the very same thing occurred to me: that using `(eval contents)' would both be more reasonable (after all, CONTENTS might be neither a symbol nor a string, but some expression!) and at the same time consistent with Noam's rewording of the docstring. Thanks! I'm in a train now, and with limited access to the internet, so I'll get back to this thread (and push the branch after clean-up - I guess I'll have to delete the current branch first, right?) soon. It's good that the Emacs manuals are available offline - I'll read about arguments to `debug' now. ;-) Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 May 2017 12:39:01 +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: To: Noam Postavsky Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14943335071023 (code B ref 21072); Tue, 09 May 2017 12:39:01 +0000 Received: (at 21072) by debbugs.gnu.org; 9 May 2017 12:38:27 +0000 Received: from localhost ([127.0.0.1]:60732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d84PK-0000GR-SP for submit@debbugs.gnu.org; Tue, 09 May 2017 08:38:27 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:52341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d84PJ-0000GI-90 for 21072@debbugs.gnu.org; Tue, 09 May 2017 08:38:25 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id EE9E7E620E; Tue, 9 May 2017 14:38:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 cEkD13R6x0ZN; Tue, 9 May 2017 14:38:18 +0200 (CEST) Received: from localhost (unknown [150.254.82.90]) by mail.mojserwer.eu (Postfix) with ESMTPSA id D72C6E6008; Tue, 9 May 2017 14:38:17 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: Date: Tue, 09 May 2017 14:39:09 +0200 Message-ID: <87efvygq6q.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Noam, Stefan et al., I finally found some time to make the branch nicer, deleted it from the server and pushed the new one. Could you look at it one more time and merge it to master (or greenlight me to do it)? Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2017 02:53: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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149438473617778 (code B ref 21072); Wed, 10 May 2017 02:53:02 +0000 Received: (at 21072) by debbugs.gnu.org; 10 May 2017 02:52:16 +0000 Received: from localhost ([127.0.0.1]:34832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8Hjb-0004cg-Ps for submit@debbugs.gnu.org; Tue, 09 May 2017 22:52:15 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:38419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8HjZ-0004cS-G9 for 21072@debbugs.gnu.org; Tue, 09 May 2017 22:52:14 -0400 Received: by mail-it0-f43.google.com with SMTP id e65so12925465ita.1 for <21072@debbugs.gnu.org>; Tue, 09 May 2017 19:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Jav+FTwWyv2pVT+pMKk6kxJo2JHL1jrooRCKk8FG9PU=; b=IZTTbRAvHoiavS+8icNFLr7DgofYb4r5lSsP/JDPvLlwk8sNsM0rlV4o8n722PcWWm CwzsSvt4xrKaBjDafIXTQNEvrHfhiOpkoZJZ9lJ8Dx7y7XAA8UcPzsjJkvkjcFQ03Agv 2Tds7GC41BnAq43duV4R9V1WN6bYmk7OQMjVZ+WkL91KB80Gh5MBShY5ql1QAxM6bQlU WTy/9R13RFFTHpuB6ENE+u9uPA0fxlb6gu9CfCLUeZ5ba7Mdu+MauCEZoH8gy3UaBj3s eaz7vssrc9H+5EiUR5N7vpmmXOaoFrWXczc/tA+iHv5udMl9wVOBiJNRfs32mYbWCKz9 /C2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Jav+FTwWyv2pVT+pMKk6kxJo2JHL1jrooRCKk8FG9PU=; b=Ud9F5++k1SCtBWsTq+moza6iIDa+Suc/5UEVHwIjOGuJvPotItp6JVPWQTbOVI3Sih qXaAflPtwkqZWFHI1nAHbB9b4HQut6miAHi+fCRq6UdXXdt/y5bhSwp9kJczacHC0G1w UN6ze7kXV76rsAQySe/eetmPq8Cdu/wc49S0+Gd8e+c54SjaXFSYYat7riiJf7kOzurp S+jsYKn+DJ9SANovCWeX54CXT2jg3Pe7jp9NuAC84vNZ4mmdARmXHtqqzSRp4V7wc1+k +8dYbBqv3ZolrUUOMoDg2w7g8a6nUHFf2pTMx8LS0lRXxKbHshr/0c4o70z+SvJzD2rh M5uw== X-Gm-Message-State: AODbwcBsTCzvMm58EpH25g+g5rgPQmqr6WTngXUyzvsAO7SmPuqag03X ARzz25Mkw0DUlw== X-Received: by 10.36.193.66 with SMTP id e63mr4293635itg.86.1494384727876; Tue, 09 May 2017 19:52:07 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id r16sm502789ioi.8.2017.05.09.19.52.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 May 2017 19:52:07 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> Date: Tue, 09 May 2017 22:53:40 -0400 In-Reply-To: <87efvygq6q.fsf@jane> (Marcin Borkowski's message of "Tue, 09 May 2017 14:39:09 +0200") Message-ID: <87pofhjubv.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Marcin Borkowski writes: > I finally found some time to make the branch nicer, deleted it from the > server and pushed the new one. Could you look at it one more time and > merge it to master (or greenlight me to do it)? [[c1c3403cf2]] > Fix Bug#21072 and rework `mark-defun' > > * test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer): > New variable > (mark-defun-no-arg-region-inactive) > (mark-defun-no-arg-region-active) > (mark-defun-arg-region-active) > (mark-defun-pos-arg-region-inactive) There should be a colon after the close paren on each of those lines. > (mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for > the new `mark-defun' > > * lisp/emacs-lisp/lisp.el (beginning-of-defun--in-emptyish-line-p): > New function > (beginning-of-defun-comments): New function > (mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun' > to accept a numerical prefix argument There should be a period at the end of each entry. [[aeed45da]] > * lisp/emacs-lisp/lisp.el (mark-defun): simplify moving the point Missing capitalization and period (if you're not just squashing this). [[b8fd2c2ca1]] > * Fix elisp-tests-with-temp-buffer compilation [...] Please add to this the patch from https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21072#254. [[7efd2f2ea1]] > Modify `beginning-of-defun-comments' If you are keeping this one, I would add to the commit message: * lisp/emacs-lisp/lisp.el (beginning-of-defun-comments): Try not to stop in the middle of a multiline comment. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2017 03:17: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: To: npostavs@users.sourceforge.net Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149438617519901 (code B ref 21072); Wed, 10 May 2017 03:17:02 +0000 Received: (at 21072) by debbugs.gnu.org; 10 May 2017 03:16:15 +0000 Received: from localhost ([127.0.0.1]:34837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8I6o-0005Au-Rc for submit@debbugs.gnu.org; Tue, 09 May 2017 23:16:15 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:24932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8I6m-0005Ai-Dv for 21072@debbugs.gnu.org; Tue, 09 May 2017 23:16:13 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AcBQCshRJZ/3Z8oWxdGgEBAQECAQEBAQgBAQEBg1WKY4V/kGIrAZdVhh4EAgKEbkQUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA2KUAi0P4pwAQEBBwImiD2DG4UvhR0BBJ4FlQaJBoZ5kn6BRDYhgQovIAguh1ckiSoBAQE X-IPAS-Result: A0AcBQCshRJZ/3Z8oWxdGgEBAQECAQEBAQgBAQEBg1WKY4V/kGIrAZdVhh4EAgKEbkQUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA2KUAi0P4pwAQEBBwImiD2DG4UvhR0BBJ4FlQaJBoZ5kn6BRDYhgQovIAguh1ckiSoBAQE X-IronPort-AV: E=Sophos;i="5.38,317,1491278400"; d="scan'208";a="312450772" Received: from 108-161-124-118.dsl.teksavvy.com (HELO ceviche.home) ([108.161.124.118]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 May 2017 23:16:00 -0400 Received: by ceviche.home (Postfix, from userid 20848) id AADE5662E0; Tue, 9 May 2017 23:15:59 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> Date: Tue, 09 May 2017 23:15:59 -0400 In-Reply-To: <87pofhjubv.fsf@users.sourceforge.net> (npostavs's message of "Tue, 09 May 2017 22:53:40 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> * test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer): >> New variable >> (mark-defun-no-arg-region-inactive) >> (mark-defun-no-arg-region-active) >> (mark-defun-arg-region-active) >> (mark-defun-pos-arg-region-inactive) > There should be a colon after the close paren on each of those lines. Actually, AFAIK the normal "many functions" format looks like: * filename (functionname1, functionname2) (functionname3, functionname4) (functionname5, functionname6) (functionname7, functionname8): New functions. we even tried to make the auto-fill code DTRT in the change-log-mode. Stefan From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2017 03:30: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: To: Stefan Monnier Cc: Marcin Borkowski , 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149438699921055 (code B ref 21072); Wed, 10 May 2017 03:30:02 +0000 Received: (at 21072) by debbugs.gnu.org; 10 May 2017 03:29:59 +0000 Received: from localhost ([127.0.0.1]:34844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8IK7-0005TX-3x for submit@debbugs.gnu.org; Tue, 09 May 2017 23:29:59 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:35359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8IK5-0005TK-5z for 21072@debbugs.gnu.org; Tue, 09 May 2017 23:29:57 -0400 Received: by mail-it0-f67.google.com with SMTP id 67so2253763itx.2 for <21072@debbugs.gnu.org>; Tue, 09 May 2017 20:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dT1CTf9KlVivvYsfnTTfWleutu/4z40x//H7jzYDyD4=; b=dtGER80E7HmwPh+lA6VBoBtHYXLaawqqljJdd7cLdAa5HRXN3zSLXcNlTFLGY5Brf9 U8qRjuSGHTHpF0QhGodRFHYmckC9qFvYi8DbpXpLuXeu7ZDggXYzit4/CfQhFf3HrN18 5yANaiOtZ/tbDyZDAt3bHrVECmpvxQva20p9FxaKQ2d8YkqXEWa65STFHzCdmtNoutqg jaiOpAugmAKTsRGjuM0Ms1cqDpjqDIbvARznPNHIUaQLFIVWvPHFjzpEkj9WqWsWQRe2 0CNqvsAMkL8R12bRl4l7Bv8H0FwLecPnt3LMK5WH6wqM4z9/LiNTeID6dIiWWS7/w1VC tJvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=dT1CTf9KlVivvYsfnTTfWleutu/4z40x//H7jzYDyD4=; b=nv1BcuS7jRgWX35GvrC/ngqpf5ajszV+4JdiWsTnWAwKGgXSfD/ViY/pDjcFN2YgJO pCwwUGns95JCBX19CvF5U6vJ6wDV/+hrIZEa13hdSBoPx5YaU7J2L56OihRjn+gvTtJr k8TqkctqWW4FFACwZ1iJ7HlXW+BSn7wg03SQEfkVe2Sq1EwjYbUCCtt7a7an/h95d2Sn WMgFt25dGKIh895DYAfbKE1w5IVmUW296RSdLoQfmQI/Jy5sqprHj/Qc7ErGuD6UEnvE ZcuMaV1RghVYGo4lUmyKmfFvR2Lkb5/JYCXwUXalrMeoQ1Qx0PnTN8Y/KXzRyX6E/gM5 yJuQ== X-Gm-Message-State: AODbwcBRPS4QSBUQM/UVtjPsO/j5iFzYWyASapXuKpb6zcuiJ6EH3w0P wG1vpFIv85FUpw== X-Received: by 10.36.228.141 with SMTP id o135mr3433651ith.40.1494386991678; Tue, 09 May 2017 20:29:51 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id o73sm538309ioi.42.2017.05.09.20.29.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 May 2017 20:29:51 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> Date: Tue, 09 May 2017 23:31:24 -0400 In-Reply-To: (Stefan Monnier's message of "Tue, 09 May 2017 23:15:59 -0400") Message-ID: <87mvaljskz.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Stefan Monnier writes: > Actually, AFAIK the normal "many functions" format looks like: > > * filename (functionname1, functionname2) > (functionname3, functionname4) > (functionname5, functionname6) > (functionname7, functionname8): New functions. > > we even tried to make the auto-fill code DTRT in the change-log-mode. Oh, huh, I took the example in CONTRIBUTE (under "Preferred form for several entries with the same content:") to mean that lines should end with colon, but I guess that only applies to multiple file entries, not functions? The GNU ChangeLog standards do indeed say to end the line with just a close paren [1]. [1]: https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2017 16:33: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: To: npostavs@users.sourceforge.net Cc: mbork@mbork.pl, monnier@iro.umontreal.ca, 21072@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149443392522690 (code B ref 21072); Wed, 10 May 2017 16:33:02 +0000 Received: (at 21072) by debbugs.gnu.org; 10 May 2017 16:32:05 +0000 Received: from localhost ([127.0.0.1]:36940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8UWy-0005tu-TV for submit@debbugs.gnu.org; Wed, 10 May 2017 12:32:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8UWx-0005tR-BY for 21072@debbugs.gnu.org; Wed, 10 May 2017 12:32:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8UWp-0007t5-5x for 21072@debbugs.gnu.org; Wed, 10 May 2017 12:31:58 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8UWp-0007sz-2C; Wed, 10 May 2017 12:31:55 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4449 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d8UWn-0002UD-Vp; Wed, 10 May 2017 12:31:54 -0400 Date: Wed, 10 May 2017 19:31:40 +0300 Message-Id: <8360h8brmb.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87mvaljskz.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> <87mvaljskz.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: npostavs@users.sourceforge.net > Date: Tue, 09 May 2017 23:31:24 -0400 > Cc: Marcin Borkowski , 21072@debbugs.gnu.org > > Stefan Monnier writes: > > > Actually, AFAIK the normal "many functions" format looks like: > > > > * filename (functionname1, functionname2) > > (functionname3, functionname4) > > (functionname5, functionname6) > > (functionname7, functionname8): New functions. > > > > we even tried to make the auto-fill code DTRT in the change-log-mode. > > Oh, huh, I took the example in CONTRIBUTE (under "Preferred form for > several entries with the same content:") to mean that lines should end > with colon, but I guess that only applies to multiple file entries, not > functions? Yes, correct. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 May 2017 09:42: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: To: npostavs@users.sourceforge.net Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.14945821048435 (code B ref 21072); Fri, 12 May 2017 09:42:02 +0000 Received: (at 21072) by debbugs.gnu.org; 12 May 2017 09:41:44 +0000 Received: from localhost ([127.0.0.1]:39734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d974x-0002Bz-Vx for submit@debbugs.gnu.org; Fri, 12 May 2017 05:41:44 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:37091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d974u-0002Bl-27 for 21072@debbugs.gnu.org; Fri, 12 May 2017 05:41:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 2A2CDE6488; Fri, 12 May 2017 11:41:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 VL4e_ba9jmhr; Fri, 12 May 2017 11:41:33 +0200 (CEST) Received: from localhost (unknown [83.13.149.242]) by mail.mojserwer.eu (Postfix) with ESMTPSA id B5840E6049; Fri, 12 May 2017 11:41:31 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski In-reply-to: <87pofhjubv.fsf@users.sourceforge.net> Date: Fri, 12 May 2017 11:42:24 +0200 Message-ID: <87inl61ke7.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.8 (/) On 2017-05-10, at 04:53, npostavs@users.sourceforge.net wrote: > Marcin Borkowski writes: > >> I finally found some time to make the branch nicer, deleted it from the >> server and pushed the new one. Could you look at it one more time and >> merge it to master (or greenlight me to do it)? > > [[c1c3403cf2]] >> Fix Bug#21072 and rework `mark-defun' >> >> * test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer): >> New variable >> (mark-defun-no-arg-region-inactive) >> (mark-defun-no-arg-region-active) >> (mark-defun-arg-region-active) >> (mark-defun-pos-arg-region-inactive) > > There should be a colon after the close paren on each of those lines. > >> (mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for >> the new `mark-defun' >> >> * lisp/emacs-lisp/lisp.el (beginning-of-defun--in-emptyish-line-p): >> New function >> (beginning-of-defun-comments): New function >> (mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun' >> to accept a numerical prefix argument > > There should be a period at the end of each entry. > > [[aeed45da]] >> * lisp/emacs-lisp/lisp.el (mark-defun): simplify moving the point > > Missing capitalization and period (if you're not just squashing this). > > > [[b8fd2c2ca1]] >> * Fix elisp-tests-with-temp-buffer compilation > [...] > > Please add to this the patch from > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21072#254. > > [[7efd2f2ea1]] >> Modify `beginning-of-defun-comments' > > If you are keeping this one, I would add to the commit message: > > * lisp/emacs-lisp/lisp.el (beginning-of-defun-comments): Try not to stop > in the middle of a multiline comment. Thanks. All done, branch deleted and pushed again. Hopefully it's ok now. (I'm still learning to write commit messages...) Best, -- Marcin Borkowski From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 May 2017 20:32:01 +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: To: Marcin Borkowski Cc: 21072@debbugs.gnu.org, Stefan Monnier Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149462106610218 (code B ref 21072); Fri, 12 May 2017 20:32:01 +0000 Received: (at 21072) by debbugs.gnu.org; 12 May 2017 20:31:06 +0000 Received: from localhost ([127.0.0.1]:41324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9HDO-0002ej-CR for submit@debbugs.gnu.org; Fri, 12 May 2017 16:31:06 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:33945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9HDM-0002eE-C1 for 21072@debbugs.gnu.org; Fri, 12 May 2017 16:31:04 -0400 Received: by mail-io0-f196.google.com with SMTP id 12so6731019iol.1 for <21072@debbugs.gnu.org>; Fri, 12 May 2017 13:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=uoBeZ7exCgi5J309OLQlPicjMG25SoUhzAN86mfYurU=; b=FZ3Y3SS5Xc74bksNAvMp+0zKC8pmuyCyq+vLB0KPqUhfiGRonO0eBAcmIE5nR8JGY2 wS0VY8eR/8GWN2szhHpTT8YB78MrRzfe3KkUazpOkjoSx3RYtH20GIZkLQ2sTgyhugKY QBNBesViAuuBgsFB4war7xQZSXWGXHVm3Ra+dllQnvrEs+oQ2xHtS9p5AFQKygmpFDzP +2mb4c5F1hKdV2z6PdQXB+9wo72bTzPcnC+9qngL2u8mR6t+6plDtXCB/zsy5xpDKxS7 hbczc7MKfTWjtWoXX/HyrbFP0Zd6AE24H+brer/n5YWKOSQxk9T7sQbh6/Cglc1EJBjW BsKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=uoBeZ7exCgi5J309OLQlPicjMG25SoUhzAN86mfYurU=; b=V+apnchbRVt+a1V9qjVplXMES8hbhm0bad4LPOJLfftd2DXnYjCpX0icAc/L5oRmpd Gc0Dv+9EegFhTY3TOSSdhJ3K1e0T+lImBoRwxCzfQqT8XhiKm9QPqmmw1vfxc2ZTe9+O jJL/OJ6Qy3zFaafgSUcHbdEewzQxduZxE4IaauBNNCzZ2pxmJC015vlp6dnKcr8oSuhV O6gAHXOex7PIstWsiecvVasYNdLAa2jwTjmkE0VgA/e4dUCKIgLzyvE5UrVWrHJsv6lI WFP2dgESFgwohUzE4UN/9Iqgp8Cr9lGylREGCWsJlSdTJVbzuNA/nXI5ze1xu0x1BhQq 3IuQ== X-Gm-Message-State: AODbwcA1KiKbfWYpWRNggt2Ko/kSew+VU48+a31cwJ4F3zFO1vEkPslE OiVVTXzfrVJ4QQ== X-Received: by 10.107.195.68 with SMTP id t65mr6737552iof.17.1494621058557; Fri, 12 May 2017 13:30:58 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id m2sm1988192itm.1.2017.05.12.13.30.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 May 2017 13:30:57 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> <87inl61ke7.fsf@jane> Date: Fri, 12 May 2017 16:32:31 -0400 In-Reply-To: <87inl61ke7.fsf@jane> (Marcin Borkowski's message of "Fri, 12 May 2017 11:42:24 +0200") Message-ID: <874lwpke8w.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Marcin Borkowski writes: > All done, branch deleted and pushed again. Hopefully it's ok now. Looks good to me. > (I'm still learning to write commit messages...) Turns out, so am I :) From unknown Mon Aug 18 17:59:38 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Raffaele Ricciardi Subject: bug#21072: closed (Re: bug#21072: Brave new mark-defun (and a testing tool)) Message-ID: References: <87d1bc10nh.fsf@jane> <55A74B3C.8030608@gmail.com> X-Gnu-PR-Message: they-closed 21072 X-Gnu-PR-Package: emacs Reply-To: 21072@debbugs.gnu.org Date: Sun, 14 May 2017 05:13:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1494738782-340-1" This is a multi-part message in MIME format... ------------=_1494738782-340-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #21072: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 21072@debbugs.gnu.org. --=20 21072: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21072 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1494738782-340-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21072-done) by debbugs.gnu.org; 14 May 2017 05:12:36 +0000 Received: from localhost ([127.0.0.1]:43462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9lpc-0008WV-AV for submit@debbugs.gnu.org; Sun, 14 May 2017 01:12:36 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:56729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9lpa-0008WM-9A for 21072-done@debbugs.gnu.org; Sun, 14 May 2017 01:12:34 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id E6603E626A; Sun, 14 May 2017 07:12:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu 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 2JMrS9AzTaLn; Sun, 14 May 2017 07:12:28 +0200 (CEST) Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 5CF15E6267; Sun, 14 May 2017 07:12:28 +0200 (CEST) References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> <87inl61ke7.fsf@jane> User-agent: mu4e 0.9.19; emacs 26.0.50 From: Marcin Borkowski To: npostavs@users.sourceforge.net Subject: Re: bug#21072: Brave new mark-defun (and a testing tool) In-reply-to: <87inl61ke7.fsf@jane> Date: Sun, 14 May 2017 07:13:22 +0200 Message-ID: <87d1bc10nh.fsf@jane> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21072-done Cc: Stefan Monnier , 21072-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2017-05-12, at 11:42, Marcin Borkowski wrote: > All done, branch deleted and pushed again. Hopefully it's ok now. (I'm > still learning to write commit messages...) Hi all, since seemingly nobody objected, I merged my branch into master and marked the bug as done. Best, -- Marcin Borkowski ------------=_1494738782-340-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Jul 2015 06:12:31 +0000 Received: from localhost ([127.0.0.1]:50563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZFcPG-0005gp-KR for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54115) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZFcPD-0005gb-Rh for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFcP7-0004hr-G4 for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFcP7-0004hn-Dx for submit@debbugs.gnu.org; Thu, 16 Jul 2015 02:12:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFcP6-0001ZP-1E for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2015 02:12:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFcP2-0004gx-Qx for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2015 02:12:19 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:33103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFcP2-0004gh-Gr for bug-gnu-emacs@gnu.org; Thu, 16 Jul 2015 02:12:16 -0400 Received: by widic2 with SMTP id ic2so6176073wid.0 for ; Wed, 15 Jul 2015 23:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=tNoZ9bCXsezadA8lEJcTjLb0n/fVhsHtrMk/SXJND2U=; b=tL27AZDnkZ+3GthGAcDi7XeiDANooiciTcoWNq/cw2BN26K3o0SUFhSxGk24TC/wbN 8AsncriQ3v21FzcO7MR30P/swbyWDvi26LaHhmHGzhY1bTsrNh9y2BkfFaeNhU6LRkE3 HlnPwzfPJWsW1ZLJjtEkQ72uhwNopgMAVH9fHx8982vEk/Z+uH4Usrsj0QPUDlk+LYzQ JEDvuV6Kwo0XHR8CfubLk0V+IJWE1e3KcAqX3COXwA5JIEp9i65kKJo8Yt7eG9Gflc+y OMIhGp6riWmtt8kdmjlMsoph/rzmj4+h3iYPjwPYo4BGKZT94RFXjphor29eXEJZ/3RV n7NQ== X-Received: by 10.194.8.40 with SMTP id o8mr15696743wja.100.1437027134608; Wed, 15 Jul 2015 23:12:14 -0700 (PDT) Received: from [192.168.1.129] (81.203.145.32.dyn.user.ono.com. [81.203.145.32]) by smtp.gmail.com with ESMTPSA id m4sm11204829wjb.37.2015.07.15.23.12.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 23:12:13 -0700 (PDT) To: bug-gnu-emacs@gnu.org From: Raffaele Ricciardi Subject: 24.5; inconsistent behaviour of `C-M-h (mark-defun)' in Emacs Lisp Message-ID: <55A74B3C.8030608@gmail.com> Date: Thu, 16 Jul 2015 08:12:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) Dear Emacs maintainers, the documentation for `mark-defun' says: The defun marked is the one that contains point or follows point. However, Emacs may mark the preceding defun instead, and it may mark an unrelated preceding comment along with the defun. Please follow this recipe: - emacs -Q - make sure that *scratch* contains the following code: ------------------------------------------------------------------------ ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun a () nil) (defun b () nil) ------------------------------------------------------------------------ - move point anywhere inside the second defun; - press `C-M-h' and Emacs will correctly mark the current defun; - press `C-g C-M-h' and Emacs will incorrectly mark the previous defun; - now move point anywhere inside the first definition; - press `C-M-h' and Emacs will correctly mark the current defun; - press `C-g C-M-h' and Emacs will incorrectly mark the defun along with the preceding comment; - now make sure that *scratch* contains the following code: ------------------------------------------------------------------------ ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun a () nil) ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun b () nil) ------------------------------------------------------------------------ - move point anywhere inside the second comment and press `C-M-h': Emacs will correctly mark the following defun; - move point anywhere inside the first comment and press `C-M-h': Emacs will incorrectly mark the comment along with the defun. Thanks for your attention. Best Regards. -- In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5) of 2015-06-23 on debian Windowing system distributor `The X.Org Foundation', version 11.0.11604000 System Description: Debian GNU/Linux 8.1 (jessie) Configured using: `configure --prefix=/opt/emacs/emacs-24.5' Important settings: value of $LC_MONETARY: en_GB.utf8 value of $LC_NUMERIC: en_GB.utf8 value of $LC_TIME: en_GB.utf8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Quit Mark set [2 times] Quit Mark set [2 times] Quit Mark set [2 times] Quit Mark set [2 times] Quit Mark set [2 times] Quit Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 73007 6360) (symbols 48 17564 0) (miscs 40 53 254) (strings 32 9482 4902) (string-bytes 1 268085) (vectors 16 8916) (vector-slots 8 383708 18759) (floats 8 64 360) (intervals 56 334 13) (buffers 960 11) (heap 1024 48896 861)) ------------=_1494738782-340-1-- From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 May 2017 00:18: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: To: 21072@debbugs.gnu.org Cc: rfflrccrd@gmail.com, mbork@mbork.pl Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149480745726795 (code B ref 21072); Mon, 15 May 2017 00:18:02 +0000 Received: (at 21072) by debbugs.gnu.org; 15 May 2017 00:17:37 +0000 Received: from localhost ([127.0.0.1]:45190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dA3hg-0006y6-BH for submit@debbugs.gnu.org; Sun, 14 May 2017 20:17:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dA3hd-0006xt-Ps for 21072@debbugs.gnu.org; Sun, 14 May 2017 20:17:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dA3hX-0000NB-N8 for 21072@debbugs.gnu.org; Sun, 14 May 2017 20:17:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNRESOLVED_TEMPLATE autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dA3hX-0000Mz-Jp; Sun, 14 May 2017 20:17:27 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dA3hV-0005mS-Md; Sun, 14 May 2017 20:17:25 -0400 From: Glenn Morris References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> <87inl61ke7.fsf@jane> <87d1bc10nh.fsf@jane> X-Spook: Storm BRLO Tamiflu ARPA Gazprom Coast Guard espionage X-Ran: qFZX__T)jZ'*0l>PRy==WgEPUe%opBdC[mLq76sjN8K,KrJl+DQxRC=(w%SZr&d.z"k:N? X-Hue: brightblue X-Attribution: GM Date: Sun, 14 May 2017 20:17:25 -0400 In-Reply-To: <87d1bc10nh.fsf@jane> (Marcin Borkowski's message of "Sun, 14 May 2017 07:13:22 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) It seems this causes two python tests to fail. See eg http://hydra.nixos.org/build/52829789 From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 May 2017 22:37: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: To: Glenn Morris Cc: mbork@mbork.pl, rfflrccrd@gmail.com, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149497421417065 (code B ref 21072); Tue, 16 May 2017 22:37:02 +0000 Received: (at 21072) by debbugs.gnu.org; 16 May 2017 22:36:54 +0000 Received: from localhost ([127.0.0.1]:49275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAl5J-0004RB-TW for submit@debbugs.gnu.org; Tue, 16 May 2017 18:36:54 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:33668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAl5H-0004Qz-Us for 21072@debbugs.gnu.org; Tue, 16 May 2017 18:36:52 -0400 Received: by mail-io0-f170.google.com with SMTP id p24so103029573ioi.0 for <21072@debbugs.gnu.org>; Tue, 16 May 2017 15:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xhBQE/nazuX8wk4LcFsP+z0+oYtDzNSqTJd1o5Sfftc=; b=pM2leNwDiWHbrXBioCfXVWhZ/GQXdZpVfbaNyw9EdoEOg3tp33iVwr/2g51Pw3LX6z NfrfPH8LfNqsORgMmiMXLugHsZfAz7oqVAqlulNHR69ZKDgZJdRAp7cZ8atvWvPSMWr+ ci8Wi/wUy1YorfErZWxfsKKoevwg0RT+Ct+WivtZPgbhqmX/ZOido1oIJaA4mKDeIReD usTbvRmRZaRje0/pMiQHQy2Zh73NcFqXKUi2nVxyRhSAgL9jpYbSWp9gM1v4AuM8RZt3 SUBSFqaJTbJKWAvy+jrWxo0TMO4Ka8HoJ76CSKdswnmPfgjMqOefcLANSqR89+nyRAj1 ZsMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=xhBQE/nazuX8wk4LcFsP+z0+oYtDzNSqTJd1o5Sfftc=; b=dvc9YGL97CmsX/dt1qYVAOhvWU1pp6ZfS7QvZz3qMNaSST2RzJVx6XY8NP2cRmfXkQ MVamfUL/FaTBWpK3KPfPcnVbhv7q09JoSTS6/sBwsb0tAmAhqN/JqpEc4mXXDjHq4XCb NEyCG62aiLch9G9WZezrhhCebqwWXKNhxWvNVL/zg3sHrpHxcmeq9qBawHnw2zzCHI7k OaVNU7EJl3uBOLDBxAiruLZOfFZPyfYsnjANSPlaJqVHwA5gCMxPvBgzrWCAUu+FBpBd 4JXOL1SGBWxuV3G2Wsy8BJHxnsUvXmC2CO67iOZwzv4VM91uEfqL7TNLmgutmbkBfM0B n1Cw== X-Gm-Message-State: AODbwcCNyxGj7QtLKa1V967eQRj+hS9bCV2ESEPLn3qYiOzP0eZoccmp 0L5bMpNB/b7cNA== X-Received: by 10.107.16.81 with SMTP id y78mr329911ioi.164.1494974206299; Tue, 16 May 2017 15:36:46 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id z85sm9089300ita.3.2017.05.16.15.36.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 May 2017 15:36:45 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> <87inl61ke7.fsf@jane> <87d1bc10nh.fsf@jane> Date: Tue, 16 May 2017 18:38:16 -0400 In-Reply-To: (Glenn Morris's message of "Sun, 14 May 2017 20:17:25 -0400") Message-ID: <87lgpwig13.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Glenn Morris writes: > It seems this causes two python tests to fail. > See eg http://hydra.nixos.org/build/52829789 It seems again to be an issue of different behaviour with transient-mark-mode disabled. From unknown Mon Aug 18 17:59:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21072: Brave new mark-defun (and a testing tool) Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 May 2017 22:29: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: To: Glenn Morris Cc: rfflrccrd@gmail.com, mbork@mbork.pl, 21072@debbugs.gnu.org Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149531933910824 (code B ref 21072); Sat, 20 May 2017 22:29:02 +0000 Received: (at 21072) by debbugs.gnu.org; 20 May 2017 22:28:59 +0000 Received: from localhost ([127.0.0.1]:57441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCCrr-0002oW-6w for submit@debbugs.gnu.org; Sat, 20 May 2017 18:28:59 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:36193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCCrp-0002oD-RF for 21072@debbugs.gnu.org; Sat, 20 May 2017 18:28:58 -0400 Received: by mail-it0-f68.google.com with SMTP id i206so8335695ita.3 for <21072@debbugs.gnu.org>; Sat, 20 May 2017 15:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8kEKjNhCXM6wcYvo0MyBlOxM7HmO+zgnIAzNwpxwK9k=; b=OJWZgXLjwRMe4rHNY/A7Vw7K+q+3Hxo6UJRmxuJl0pHPk7326qB9YVfdPZbIf3gExX u1s2nc83oOgUjIxsJ5yAfz6Lg9ub0TwDFJiSQDevx4AygsSWq6bm/tipWuP0iQQOULxz y8TvpIO5mqAvJOVRUK/HIa+mbBwBHS94U0oTNYvSJ4USOs5iFomLdsqRiHKUvCklV9/F eLiCSi11zixGzVou1wjoQC7OUUksRQCxtny+tVSpGwwtyPHh7JPK43GNvZTGzIw3z+fi iVDChcGkqLvLMRKLptju9S4Lpbgo5YKjdrvcx3beqCDK8IwbolUGphQ9f1J6SIP0kURf bMaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8kEKjNhCXM6wcYvo0MyBlOxM7HmO+zgnIAzNwpxwK9k=; b=gf8lT9PQO+Ur4j2IthQkxBVLQFw+82VshYyD7t8u1+YVHndEFqH7Z1/fiWs0oyE0zv 0+pfjyqOf5X5TL1dt6jDPjWut/LEfsAcnUio527AtoPKvlDtfpu73sYTypZpLsRQER7P LAslqQCLy62FT6/hmgYBb04olXKSbxsFL/ZWYKbDaTbeY9K81HnWc5NMgfglQfqrvGcE RM+kCwhGycvCyN1PdxJDNsfd4JyEDjz7/q1iMRbqDGGtoJg3fGpadsaBey8HJMxhT+mQ wz4aV7EjKaxd4QlnwMHDolsFjUqV0p2oQugpYp/NEJPczcwx7hWEnKp8H3oYL4E2MPTt YSCQ== X-Gm-Message-State: AODbwcDk7rsJJI5ZvpFGzxVPgWWpK5im1W+mvp2uFqOVxiCMSVl1mBa3 U++tzPfF1xwZGw== X-Received: by 10.36.65.103 with SMTP id x100mr17195804ita.5.1495319332246; Sat, 20 May 2017 15:28:52 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 192sm1405764itl.1.2017.05.20.15.28.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 May 2017 15:28:51 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87o9ydrzkr.fsf@mbork.pl> <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> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> <8737cyotmt.fsf@users.sourceforge.net> <87h919yf5g.fsf@jane> <87efvygq6q.fsf@jane> <87pofhjubv.fsf@users.sourceforge.net> <87inl61ke7.fsf@jane> <87d1bc10nh.fsf@jane> <87lgpwig13.fsf@users.sourceforge.net> Date: Sat, 20 May 2017 18:30:28 -0400 In-Reply-To: <87lgpwig13.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Tue, 16 May 2017 18:38:16 -0400") Message-ID: <87lgprgnzv.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) npostavs@users.sourceforge.net writes: > Glenn Morris writes: > >> It seems this causes two python tests to fail. >> See eg http://hydra.nixos.org/build/52829789 > > It seems again to be an issue of different behaviour with > transient-mark-mode disabled. I've set the tests to use transient-mark-mode [1: ee54d2f4e4], we might have to revisit the non transient-mark-mode behaviour though. [1: ee54d2f4e4]: 2017-05-20 18:28:23 -0400 ; Set transient-mark-mode to let mark-defun tests pass http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ee54d2f4e439b4a211c8fb7541ce22bac65bde8f