From unknown Mon Aug 18 14:26:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16328 <16328@debbugs.gnu.org> To: bug#16328 <16328@debbugs.gnu.org> Subject: Status: 24.3.50; [PATCH] Enable narrowing to defun with function header comments also visible Reply-To: bug#16328 <16328@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:26:20 +0000 retitle 16328 24.3.50; [PATCH] Enable narrowing to defun with function head= er comments also visible reassign 16328 emacs submitter 16328 Phil Sainty severity 16328 wishlist tag 16328 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 03 03:58:08 2014 Received: (at submit) by debbugs.gnu.org; 3 Jan 2014 08:58:08 +0000 Received: from localhost ([127.0.0.1]:59218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vz0Zz-0004Ex-Qn for submit@debbugs.gnu.org; Fri, 03 Jan 2014 03:58:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35429) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vz0Zw-0004En-4O for submit@debbugs.gnu.org; Fri, 03 Jan 2014 03:58:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz0Zm-0007qm-1j for submit@debbugs.gnu.org; Fri, 03 Jan 2014 03:58:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz0Zl-0007qh-Ui for submit@debbugs.gnu.org; Fri, 03 Jan 2014 03:57:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz0Zd-0003KC-Oj for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 03:57:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz0ZV-0007ny-L1 for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 03:57:45 -0500 Received: from nctlincom01.orcon.net.nz ([60.234.4.69]:53880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz0ZV-0007mK-5F for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 03:57:37 -0500 Received: from mx3.orcon.net.nz (mx3.orcon.net.nz [219.88.242.53]) by nctlincom01.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id s039BCsm005756 for ; Fri, 3 Jan 2014 22:11:12 +1300 Received: from Debian-exim by mx3.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1Vz0ZP-0000uC-IW for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 21:57:31 +1300 Received: from [121.99.80.47] (helo=[10.1.1.3]) by mx3.orcon.net.nz with esmtpa (Exim 4.69) (envelope-from ) id 1Vz0ZP-0000tl-BK for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 21:57:31 +1300 Message-ID: <52C67B72.3010607@orcon.net.nz> Date: Fri, 03 Jan 2014 21:57:22 +1300 From: Phil Sainty User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.3.50; [PATCH] Enable narrowing to defun with function header comments also visible Content-Type: multipart/mixed; boundary="------------040307040501030803030506" X-DSPAM-Check: by mx3.orcon.net.nz on Fri, 03 Jan 2014 21:57:31 +1300 X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Jan 3 21:57:31 2014 X-DSPAM-Confidence: 0.5302 X-DSPAM-Probability: 0.0000 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-CanIt-Geo: ip=121.99.80.47; country=NZ; region=E7; city=Auckland; latitude=-36.8667; longitude=174.7667; http://maps.google.com/maps?q=-36.8667,174.7667&z=6 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 06L9lbcFR - 6c0fc760a212 - 20140103 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.174 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: -5.0 (-----) 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: -5.0 (-----) This is a multi-part message in MIME format. --------------040307040501030803030506 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit For languages where the programmer must resort to function header comments to describe a function, I've always found it frustrating that `narrow-to-defun' cuts out this often-critical information. This patch provides a new function `narrow-to-defun-including-comments' to keep these comments visible when narrowing. As there may be multiple per-line comments instead of a single block comment, I'm skipping back past ALL preceding comments. That seemed reasonable instead of trying to guess how the author has structured their comments. Stopping at an empty line would *probably* be okay, but in the end I figured that potentially showing too much seemed better than showing too little. (I've included a check for page breaks within the comments, however, as I was confident about excluding anything before one of those.) I didn't think it was wise to encourage users to modify the behaviour of `narrow-to-defun' itself (I certainly have programmatic uses for that), so instead I've indicated the way to remap the interactive bindings for users who wish to use this as standard. -Phil --------------040307040501030803030506 Content-Type: text/plain; charset=windows-1252; name="narrow-to-defun-include-comments.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="narrow-to-defun-include-comments.patch" diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 3ff4f64..4e2dd45 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -444,10 +444,32 @@ it marks the next defun after the ones already marked." (beginning-of-defun)) (re-search-backward "^\n" (- (point) 1) t))))) +(defvar narrow-to-defun-include-comments nil + "If non-nil, `narrow-to-defun' will also show comments preceding the defun. + +You should call `narrow-to-defun-including-comments' instead of setting +this value manually.") + +(defun narrow-to-defun-including-comments () + "Make text outside current defun and its preceding comments invisible. +The current defun is the one that contains point or follows point. + +If you wish to always use this interactively instead of `narrow-to-defun', +you should remap its key bindings: + + (global-set-key [remap narrow-to-defun] 'narrow-to-defun-including-comments)" + (interactive) + (let ((narrow-to-defun-include-comments t)) + (narrow-to-defun))) + (defun narrow-to-defun (&optional _arg) "Make text outside current defun invisible. -The defun visible is the one that contains point or follows point. -Optional ARG is ignored." +The current defun is the one that contains point or follows point. + +Optional ARG is ignored. + +To make any comments preceding the defun visible as well, call +`narrow-to-defun-including-comments' instead." (interactive) (save-excursion (widen) @@ -484,6 +506,18 @@ Optional ARG is ignored." (setq end (point)) (beginning-of-defun) (setq beg (point))) + (when narrow-to-defun-include-comments + (goto-char beg) + ;; Move back past all preceding comments (and whitespace). + (when (forward-comment -1) + (while (forward-comment -1)) + ;; Move forwards past any page breaks within these comments. + (when (and page-delimiter (not (string= page-delimiter ""))) + (while (re-search-forward page-delimiter beg t))) + ;; Lastly, move past any empty lines. + (skip-chars-forward "[:space:]\n") + (beginning-of-line) + (setq beg (point)))) (goto-char end) (re-search-backward "^\n" (- (point) 1) t) (narrow-to-region beg end)))) --------------040307040501030803030506-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 03 09:57:56 2014 Received: (at submit) by debbugs.gnu.org; 3 Jan 2014 14:57:56 +0000 Received: from localhost ([127.0.0.1]:59979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vz6CB-00073B-VM for submit@debbugs.gnu.org; Fri, 03 Jan 2014 09:57:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53243) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vz6C8-000734-HU for submit@debbugs.gnu.org; Fri, 03 Jan 2014 09:57:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz6By-00041i-9n for submit@debbugs.gnu.org; Fri, 03 Jan 2014 09:57:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz6By-00041e-6Z for submit@debbugs.gnu.org; Fri, 03 Jan 2014 09:57:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz6Bq-0005av-36 for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 09:57:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz6Bh-0003yY-Ty for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 09:57:34 -0500 Received: from nctlincom02.orcon.net.nz ([60.234.4.76]:58804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz6Bh-0003xb-Bu for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2014 09:57:25 -0500 Received: from mx6.orcon.net.nz (mx6.orcon.net.nz [219.88.242.56]) by nctlincom02.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id s03F56B4028026 for ; Sat, 4 Jan 2014 04:05:06 +1300 Received: from Debian-exim by mx6.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1Vz5WL-0001TJ-8t for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 03:14:41 +1300 Received: from [121.99.80.47] (helo=[10.1.1.3]) by mx6.orcon.net.nz with esmtpa (Exim 4.69) (envelope-from ) id 1Vz5WL-0001Sq-4p for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2014 03:14:41 +1300 Message-ID: <52C6C5C7.7000705@orcon.net.nz> Date: Sat, 04 Jan 2014 03:14:31 +1300 From: Phil Sainty User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Re: 24.3.50; [PATCH] Enable narrowing to defun with function header comments also visible References: <52C67B72.3010607@orcon.net.nz> In-Reply-To: <52C67B72.3010607@orcon.net.nz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-DSPAM-Check: by mx6.orcon.net.nz on Sat, 04 Jan 2014 03:14:41 +1300 X-DSPAM-Result: Innocent X-DSPAM-Processed: Sat Jan 4 03:14:41 2014 X-DSPAM-Confidence: 0.6134 X-DSPAM-Probability: 0.0000 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-CanIt-Geo: ip=121.99.80.47; country=NZ; region=E7; city=Auckland; latitude=-36.8667; longitude=174.7667; http://maps.google.com/maps?q=-36.8667,174.7667&z=6 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 05L9r56D2 - 56090f81d703 - 20140104 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.175 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: -5.0 (-----) 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: -5.0 (-----) On 3/01/2014 21:57, Phil Sainty wrote: > I didn't think it was wise to encourage users to modify the behaviour > of `narrow-to-defun' itself (I certainly have programmatic uses for > that) Actually, that was a complete lie. The code I was thinking of uses c-mark-function, not narrow-to-defun. Maybe it would be completely fine to just make this a user option, with no added function? OTOH, me not using it obviously doesn't mean no one does, so the more-cautious approach may still be preferable? From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 03 11:38:27 2014 Received: (at 16328) by debbugs.gnu.org; 3 Jan 2014 16:38:27 +0000 Received: from localhost ([127.0.0.1]:60134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vz7lS-0001TE-4Z for submit@debbugs.gnu.org; Fri, 03 Jan 2014 11:38:26 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:47657) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vz7lP-0001T6-OR for 16328@debbugs.gnu.org; Fri, 03 Jan 2014 11:38:24 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s03GcM5A018983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 3 Jan 2014 16:38:23 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s03GcLIX024081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Jan 2014 16:38:21 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s03GcLAU024075; Fri, 3 Jan 2014 16:38:21 GMT MIME-Version: 1.0 Message-ID: Date: Fri, 3 Jan 2014 08:38:20 -0800 (PST) From: Drew Adams To: Phil Sainty , 16328@debbugs.gnu.org Subject: RE: bug#16328: 24.3.50; [PATCH] Enable narrowing to defun with function header comments also visible References: <52C67B72.3010607@orcon.net.nz> In-Reply-To: <52C67B72.3010607@orcon.net.nz> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 16328 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: -2.9 (--) > For languages where the programmer must resort to function header > comments to describe a function, I've always found it frustrating > that `narrow-to-defun' cuts out this often-critical information. >=20 > This patch provides a new function `narrow-to-defun-including- > comments' to keep these comments visible when narrowing. >=20 > As there may be multiple per-line comments instead of a single block > comment, I'm skipping back past ALL preceding comments. That seemed > reasonable instead of trying to guess how the author has structured > their comments. Stopping at an empty line would *probably* be okay, > but in the end I figured that potentially showing too much seemed > better than showing too little. >=20 > (I've included a check for page breaks within the comments, however, > as I was confident about excluding anything before one of those.) >=20 > I didn't think it was wise to encourage users to modify the > behaviour of `narrow-to-defun' itself (I certainly have programmatic > uses for that), so instead I've indicated the way to remap the > interactive bindings for users who wish to use this as standard. Hi Phil. I wonder whether we couldn't just modify `narrow-to-defun', changing to (interactive "P") and using the unused argument as prefix arg to get this behavior? Perhaps someone knows more about the history of that argument. Grepping the Emacs sources, at least, I see no programmatic uses of `narrow-to-defun' that pass an argument. And anyway, the argument is ignored. But presumably we would have kept the unused argument to allow `narrow-to-defun' to be used as a functional argument in a context where it might receive an argument? If there were such uses then perhaps passing the prefix arg could prove problematic. Dunno. Anyway, seems reasonable to try, or at least to investigate. `C-u C-x n d' would then already be one key binding for this. [BTW, I didn't check your code, but if it doesn't already, it could perhaps use code similar to that of `reposition-window', to determine the starting point for the narrowing. That command (`C-M-l') is somewhat similar.] From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 04 03:41:52 2014 Received: (at 16328) by debbugs.gnu.org; 4 Jan 2014 08:41:52 +0000 Received: from localhost ([127.0.0.1]:32988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzMnn-0006ae-T9 for submit@debbugs.gnu.org; Sat, 04 Jan 2014 03:41:52 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:52236) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VzMnl-0006aV-Ps for 16328@debbugs.gnu.org; Sat, 04 Jan 2014 03:41:50 -0500 Received: by mail-we0-f169.google.com with SMTP id w61so14431231wes.0 for <16328@debbugs.gnu.org>; Sat, 04 Jan 2014 00:41:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=tDiOwlriQqEyF8C44zdFdcw4EMIsf8y1H5CbGq6kLXg=; b=cVeCuVvxEhCbTM0ZKlfA2XO1kKOOPAXi/+CKUMXybNkHfH0jt1NrA/GLfNh5mu2wwT HwFDX1oMaacN+VmrR+wdPW7V8ho5Z0+QF+GMqNK9CeZ0WjHtf7kXMFcJ8HlyZmu6PlrW pcdff2FVVE9H75U9VM7WTjzczX8+Zu2KBkQ1WMjirzF3f+lv+p06UJNMY75NfAyqUww+ Qv3QFdTfkPWgpWQvI3mPISx93K03/YpyputDkqXv+hLV7RZZFhxocrZ46u69P8jK5edK N4Pk/326OPhw2DG9nnhIuQnfOF7QWYpSCHDbLRntU0X/nfbwupu0/WQiltEAGrGEPVtm e2xg== X-Gm-Message-State: ALoCoQmzqc6gjlQk2OMkTXMWnsLOUX3Asn96Dcmigut30QoW3L57LEdculwuH8dX3lLOEfq6Tjnu X-Received: by 10.194.77.106 with SMTP id r10mr2604wjw.91.1388824908877; Sat, 04 Jan 2014 00:41:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.24.7 with HTTP; Sat, 4 Jan 2014 00:41:18 -0800 (PST) In-Reply-To: References: <52C67B72.3010607@orcon.net.nz> From: Josh Date: Sat, 4 Jan 2014 00:41:18 -0800 X-Google-Sender-Auth: acqfC9RgdeJOvnCtbUw3GVtlPIE Message-ID: Subject: Re: bug#16328: 24.3.50; [PATCH] Enable narrowing to defun with function header comments also visible To: Drew Adams Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16328 Cc: Phil Sainty , 16328@debbugs.gnu.org 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: -0.7 (/) Unpolished but related: http://paste.lisp.org/display/136136 On Fri, Jan 3, 2014 at 8:38 AM, Drew Adams wrote: >> For languages where the programmer must resort to function header >> comments to describe a function, I've always found it frustrating >> that `narrow-to-defun' cuts out this often-critical information. >> >> This patch provides a new function `narrow-to-defun-including- >> comments' to keep these comments visible when narrowing. >> >> As there may be multiple per-line comments instead of a single block >> comment, I'm skipping back past ALL preceding comments. That seemed >> reasonable instead of trying to guess how the author has structured >> their comments. Stopping at an empty line would *probably* be okay, >> but in the end I figured that potentially showing too much seemed >> better than showing too little. >> >> (I've included a check for page breaks within the comments, however, >> as I was confident about excluding anything before one of those.) >> >> I didn't think it was wise to encourage users to modify the >> behaviour of `narrow-to-defun' itself (I certainly have programmatic >> uses for that), so instead I've indicated the way to remap the >> interactive bindings for users who wish to use this as standard. > > Hi Phil. I wonder whether we couldn't just modify `narrow-to-defun', > changing to (interactive "P") and using the unused argument as prefix > arg to get this behavior? > > Perhaps someone knows more about the history of that argument. > Grepping the Emacs sources, at least, I see no programmatic uses of > `narrow-to-defun' that pass an argument. And anyway, the argument > is ignored. > > But presumably we would have kept the unused argument to allow > `narrow-to-defun' to be used as a functional argument in a context > where it might receive an argument? If there were such uses then > perhaps passing the prefix arg could prove problematic. Dunno. > > Anyway, seems reasonable to try, or at least to investigate. > `C-u C-x n d' would then already be one key binding for this. > > [BTW, I didn't check your code, but if it doesn't already, it could > perhaps use code similar to that of `reposition-window', to determine > the starting point for the narrowing. That command (`C-M-l') is > somewhat similar.] > > > From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 03 22:04:28 2014 Received: (at 16328-done) by debbugs.gnu.org; 4 Jul 2014 02:04:28 +0000 Received: from localhost ([127.0.0.1]:42169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2srT-0006fk-Nd for submit@debbugs.gnu.org; Thu, 03 Jul 2014 22:04:27 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:11693) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2srQ-0006fT-Ty for 16328-done@debbugs.gnu.org; Thu, 03 Jul 2014 22:04:25 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4mBwsUGA0kiAQI0hkXjnoHhDgEqRmBaoFxgVsh X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4mBwsUGA0kiAQI0hkXjnoHhDgEqRmBaoFxgVsh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="76324500" Received: from 75-119-224-253.dsl.teksavvy.com (HELO ceviche.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Jul 2014 22:04:19 -0400 Received: by ceviche.home (Postfix, from userid 20848) id F1E3D660FA; Thu, 3 Jul 2014 22:04:18 -0400 (EDT) From: Stefan Monnier To: Phil Sainty Subject: Re: bug#16328: 24.3.50; [PATCH] Enable narrowing to defun with function header comments also visible Message-ID: References: <52C67B72.3010607@orcon.net.nz> Date: Thu, 03 Jul 2014 22:04:18 -0400 In-Reply-To: <52C67B72.3010607@orcon.net.nz> (Phil Sainty's message of "Fri, 03 Jan 2014 21:57:22 +1300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 16328-done Cc: 16328-done@debbugs.gnu.org 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: 0.3 (/) Version:24.5 > This patch provides a new function `narrow-to-defun-including-comments' > to keep these comments visible when narrowing. I installed your patch into trunk, except that it only includes the narrow-to-defun-include-comments variable and no new command. Maybe we could make C-u toggle choose between the two behaviors. Or switch between the two choices when repeating the command. Thank you very much, and sorry for the delay, Stefan From unknown Mon Aug 18 14:26:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 01 Aug 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 04 12:35:32 2014 Received: (at control) by debbugs.gnu.org; 4 Oct 2014 16:35:32 +0000 Received: from localhost ([127.0.0.1]:33183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaSIt-0002m9-8U for submit@debbugs.gnu.org; Sat, 04 Oct 2014 12:35:31 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:60039) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaSIr-0002lz-Gi for control@debbugs.gnu.org; Sat, 04 Oct 2014 12:35:29 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XaSIq-0005r2-MO; Sat, 04 Oct 2014 12:35:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21552.8656.554316.921175@gnu.org> Date: Sat, 4 Oct 2014 12:35:28 -0400 From: Glenn Morris To: GNU bug tracker automated control server Subject: Update Emacs archived fixed bugs for 24.5 version number change X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control 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: -5.0 (-----) unarchive 18304 fixed 18304 25.1 notfixed 18304 24.5 unarchive 12008 fixed 12008 25.1 notfixed 12008 24.5 unarchive 17110 fixed 17110 25.1 notfixed 17110 24.5 unarchive 17218 fixed 17218 25.1 notfixed 17218 24.5 unarchive 18222 fixed 18222 25.1 notfixed 18222 24.5 unarchive 18023 fixed 18023 25.1 notfixed 18023 24.5 unarchive 17225 fixed 17225 25.1 notfixed 17225 24.5 unarchive 16626 fixed 16626 25.1 notfixed 16626 24.5 unarchive 18326 fixed 18326 25.1 notfixed 18326 24.5 unarchive 18227 fixed 18227 25.1 notfixed 18227 24.5 unarchive 16328 fixed 16328 25.1 notfixed 16328 24.5 unarchive 17333 fixed 17333 25.1 notfixed 17333 24.5 unarchive 13837 fixed 13837 25.1 notfixed 13837 24.5 unarchive 17641 fixed 17641 25.1 notfixed 17641 24.5 unarchive 18341 fixed 18341 25.1 notfixed 18341 24.5 unarchive 18349 fixed 18349 25.1 notfixed 18349 24.5 unarchive 2151 fixed 2151 25.1 notfixed 2151 24.5 unarchive 5853 fixed 5853 25.1 notfixed 5853 24.5 unarchive 17857 fixed 17857 25.1 notfixed 17857 24.5 unarchive 17858 fixed 17858 25.1 notfixed 17858 24.5 unarchive 17859 fixed 17859 25.1 notfixed 17859 24.5 unarchive 17160 fixed 17160 25.1 notfixed 17160 24.5 unarchive 2263 fixed 2263 25.1 notfixed 2263 24.5 unarchive 18368 fixed 18368 25.1 notfixed 18368 24.5 unarchive 17772 fixed 17772 25.1 notfixed 17772 24.5 unarchive 17276 fixed 17276 25.1 notfixed 17276 24.5 unarchive 15991 fixed 15991 25.1 notfixed 15991 24.5 unarchive 17699 fixed 17699 25.1 notfixed 17699 24.5 From unknown Mon Aug 18 14:26:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Nov 2014 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator