From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 13:00:35 2015 Received: (at submit) by debbugs.gnu.org; 2 Jun 2015 17:00:36 +0000 Received: from localhost ([127.0.0.1]:37843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzpYJ-0006A2-5o for submit@debbugs.gnu.org; Tue, 02 Jun 2015 13:00:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37400) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzpYG-00069o-C8 for submit@debbugs.gnu.org; Tue, 02 Jun 2015 13:00:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzpYA-0003pO-7b for submit@debbugs.gnu.org; Tue, 02 Jun 2015 13:00:26 -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.7 required=5.0 tests=BAYES_00, FSL_HELO_BARE_IP_2, RCVD_NUMERIC_HELO autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzpYA-0003p8-5H for submit@debbugs.gnu.org; Tue, 02 Jun 2015 13:00:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzpY0-00030C-T5 for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 13:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzpXw-0003ZY-KX for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 13:00:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:52306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzpXw-0003Yd-Eh for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 13:00:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YzpXp-0006wl-KC for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 19:00:05 +0200 Received: from 80.169.169.174 ([80.169.169.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Jun 2015 19:00:05 +0200 Received: from eda by 80.169.169.174 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Jun 2015 19:00:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Ed Avis Subject: 24.4; narrow-to-line Date: Tue, 2 Jun 2015 16:55:27 +0000 (UTC) Lines: 3 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 80.169.169.174 (Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:38.0) Gecko/20100101 Firefox/38.0 Cyberfox/38.0.5) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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: -3.2 (---) 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: -3.2 (---) It would be handy to have M-x narrow-to-line to narrow the buffer to the line point is currently on. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 14:15:06 2015 Received: (at 20723) by debbugs.gnu.org; 2 Jun 2015 18:15:06 +0000 Received: from localhost ([127.0.0.1]:37906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzqiP-0007x0-K6 for submit@debbugs.gnu.org; Tue, 02 Jun 2015 14:15:06 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:28518) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzqiL-0007wD-Sy for 20723@debbugs.gnu.org; Tue, 02 Jun 2015 14:15:03 -0400 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 t52IEtMZ006402 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Jun 2015 18:14:55 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t52IEtdM027456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 2 Jun 2015 18:14:55 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t52IEt77002169; Tue, 2 Jun 2015 18:14:55 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 2 Jun 2015 11:14:54 -0700 (PDT) From: Drew Adams To: Ed Avis , 20723@debbugs.gnu.org Subject: RE: bug#20723: 24.4; narrow-to-line References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20723 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.3 (--) > It would be handy to have M-x narrow-to-line to narrow the buffer to > the line point is currently on. (defun narrow-to-line (&optional arg) "Narrow to the text of the current line. A numeric prefix arg means move forward (backward if negative) that many lines, thus narrowing to a line other than the one point was originally in." (interactive "P") (setq arg (if arg (prefix-numeric-value arg) 0)) (let ((inhibit-field-motion t)) (save-excursion (forward-line arg) (narrow-to-region (line-beginning-position) (line-end-position))))) (defun mark-line (&optional arg) "Put mark at end of line, point at beginning. A numeric prefix arg means move forward (backward if negative) that many lines, thus marking a line other than the one point was originally in." (interactive "P") (setq arg (if arg (prefix-numeric-value arg) 0)) (let ((inhibit-field-motion t)) (forward-line arg) (push-mark nil t t) (goto-char (line-end-position)))) The problem is what keys, if any, to bind them to by default. Here are some existing commands that are similar: http://www.gnu.org/software/emacs/manual/html_node/emacs/Narrowing.html http://www.gnu.org/software/emacs/manual/html_node/emacs/Marking-Objects.ht= ml From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 14:23:21 2015 Received: (at submit) by debbugs.gnu.org; 2 Jun 2015 18:23:21 +0000 Received: from localhost ([127.0.0.1]:37913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzqqP-00088d-85 for submit@debbugs.gnu.org; Tue, 02 Jun 2015 14:23:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53511) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzqqN-00088P-Ay for submit@debbugs.gnu.org; Tue, 02 Jun 2015 14:23:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzqqH-0002XJ-Ad for submit@debbugs.gnu.org; Tue, 02 Jun 2015 14:23: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=0.7 required=5.0 tests=BAYES_05,FSL_HELO_BARE_IP_2, RCVD_NUMERIC_HELO autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqqH-0002XC-7F for submit@debbugs.gnu.org; Tue, 02 Jun 2015 14:23:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqqG-0005cT-JY for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:23:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yzqq9-0002Tw-T6 for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:23:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:57529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzqq9-0002Tn-M2 for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:23:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Yzqq8-0008ER-Dc for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 20:23:04 +0200 Received: from 80.169.169.174 ([80.169.169.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Jun 2015 20:23:04 +0200 Received: from eda by 80.169.169.174 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Jun 2015 20:23:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Ed Avis Subject: Re: bug#20723: 24.4; narrow-to-line Date: Tue, 2 Jun 2015 18:22:58 +0000 (UTC) Lines: 6 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 80.169.169.174 (Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:38.0) Gecko/20100101 Firefox/38.0 Cyberfox/38.0.5) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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: -3.2 (---) 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: -3.2 (---) Thanks. I was imagining that narrow-to-line would not be bound to any key by default. After all, even narrow-to-region comes with a warning that it is for experts only. -- Ed Avis From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 14:32:48 2015 Received: (at 20723) by debbugs.gnu.org; 2 Jun 2015 18:32:48 +0000 Received: from localhost ([127.0.0.1]:37917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzqzY-0008Mg-1F for submit@debbugs.gnu.org; Tue, 02 Jun 2015 14:32:48 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:61636) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzqzV-0008MV-Ot for 20723@debbugs.gnu.org; Tue, 02 Jun 2015 14:32:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAPj1bVWkD4Xx/2dsb2JhbABbhEKsaAEBAQEBAQaZVQKCDAEBAQEBAYELhCMBAQR5EAgDISUPAQRJE4gt2nkBAQEBBgEBAQEehhmFKoUGB4QtBaYTj0sjg3o8MYJHAQEB Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 02 Jun 2015 20:32:45 +0200 From: Nicolas Richard To: Ed Avis Subject: Re: bug#20723: 24.4; narrow-to-line References: Date: Tue, 02 Jun 2015 20:32:44 +0200 In-Reply-To: (Ed Avis's message of "Tue, 2 Jun 2015 16:55:27 +0000 (UTC)") Message-ID: <87bngyvu43.fsf@members.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20723 Cc: 20723@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: -2.3 (--) Ed Avis writes: > It would be handy to have M-x narrow-to-line to narrow the buffer to the > line point is currently on. I'll give my own experience : I wanted a similar command and first wrote a naive command along the lines of : (narrow-to-region (point-at-bol) (save-excursion (forward-line 1) (point))) but then, when widening the view, the window-start is usually modified and I found this annoying. What I now have in my .emacs is what follows. It keeps track of window-start and resets it when widening. Not very clean code, but it worked good enough for me until now. (defvar-local yf/narrow-to-line--state nil) (defun yf/narrow-to-line () (interactive) (setq yf/narrow-to-line--state (list (selected-window) (window-start))) (narrow-to-region (point-at-bol) (save-excursion (forward-line 1) (point))) (add-hook 'post-command-hook #'yf/unnarrow-to-line nil t)) (defun yf/unnarrow-to-line () (when (and yf/narrow-to-line--state (not (buffer-narrowed-p))) (apply #'set-window-start yf/narrow-to-line--state) (setq yf/narrow-to-line--state nil) (remove-hook 'post-command-hook #'yf/unnarrow-to-line t))) (bind-key "l" 'yf/narrow-to-line narrow-map) FWIW, totally unrelated, but I also have the following : (defun yf/narrow-to-window-view (printmsg) (interactive "p") (narrow-to-region (window-start) (save-excursion (goto-char (window-end nil t)) (when (not (pos-visible-in-window-p)) ;; Line is not fully visible. (forward-visible-line -1)) (point))) (when printmsg (message "Narrowed to visible portion of buffer in current window."))) (bind-key "v" 'yf/narrow-to-window-view narrow-map) -- Nico From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 15:35:17 2015 Received: (at 20723) by debbugs.gnu.org; 2 Jun 2015 19:35:17 +0000 Received: from localhost ([127.0.0.1]:37945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yzry0-0001PC-PT for submit@debbugs.gnu.org; Tue, 02 Jun 2015 15:35:17 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48864) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yzrxy-0001Oy-2L for 20723@debbugs.gnu.org; Tue, 02 Jun 2015 15:35:14 -0400 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 t52JZ8CZ027249 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Jun 2015 19:35:08 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t52JZ7Hk020514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 2 Jun 2015 19:35:07 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t52JZ7IJ021314; Tue, 2 Jun 2015 19:35:07 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 2 Jun 2015 12:35:06 -0700 (PDT) From: Drew Adams To: Ed Avis , 20723@debbugs.gnu.org Subject: RE: bug#20723: 24.4; narrow-to-line References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20723 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.3 (--) > Thanks. I was imagining that narrow-to-line would not be bound to > any key by default. After all, even narrow-to-region comes with a warnin= g > that it is for experts only. `narrow-to-region' is not for experts only. It is disabled by default because the thought is that if you don't expect it then you could get confused, especially if you invoked it accidentally (e.g., by key). But it nevertheless has a key binding by default. I don't expect that `mark-line' is very useful. But I can see someone wanting to use something like `narrow-to-line' (especially with very long lines). (Of course, `C-a C-SPC C-e C-x n' does the same thing, except for keeping the cursor where it was.) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 21:05:38 2019 Received: (at 20723) by debbugs.gnu.org; 6 Nov 2019 02:05:38 +0000 Received: from localhost ([127.0.0.1]:39358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSAhV-0007QG-O6 for submit@debbugs.gnu.org; Tue, 05 Nov 2019 21:05:38 -0500 Received: from host.gofardesign.uk ([208.79.239.190]:59143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSAhP-0007Px-JP for 20723@debbugs.gnu.org; Tue, 05 Nov 2019 21:05:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TLQ3yU6DRcu/zD7RPEQeSg4I8tCJptUk/NrTzW6hCQo=; b=hhdLtqStrBnyBJadg9PmlfVK7g BNSc8McY6ZhT0cqd5BuhsZEmFi5WUTxeQL8YpH+SGk6knsm3O6LA65+M6zVKSYOTACL6eXv568KqZ M/3RWeV236nsKbs0fzbmfo6rFW9KVIyGHyCCoExTGi9U8wnWShMW7kv8HWtygCIeu1Ec=; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:47534 helo=localhost) by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iSAhD-0007Qj-MT; Tue, 05 Nov 2019 20:05:24 -0600 From: Stefan Kangas To: Drew Adams Subject: Re: bug#20723: 24.4; narrow-to-line In-Reply-To: (Drew Adams's message of "Tue, 2 Jun 2015 11:14:54 -0700 (PDT)") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Date: Wed, 06 Nov 2019 03:05:17 +0100 Message-ID: <87mud94v4y.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: host.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 20723 Cc: 20723@debbugs.gnu.org, Ed Avis 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 (-) Drew Adams writes: >> It would be handy to have M-x narrow-to-line to narrow the buffer to >> the line point is currently on. > > (defun narrow-to-line (&optional arg) > "Narrow to the text of the current line. > A numeric prefix arg means move forward (backward if negative) that > many lines, thus narrowing to a line other than the one point was > originally in." > (interactive "P") > (setq arg (if arg (prefix-numeric-value arg) 0)) > (let ((inhibit-field-motion t)) > (save-excursion > (forward-line arg) > (narrow-to-region (line-beginning-position) (line-end-position))))) > > (defun mark-line (&optional arg) > "Put mark at end of line, point at beginning. > A numeric prefix arg means move forward (backward if negative) that > many lines, thus marking a line other than the one point was > originally in." > (interactive "P") > (setq arg (if arg (prefix-numeric-value arg) 0)) > (let ((inhibit-field-motion t)) > (forward-line arg) > (push-mark nil t t) > (goto-char (line-end-position)))) I think the proposal to add these commands make sense, since there seems to exist a user demand. Would anyone object to including the above commands in Emacs? > The problem is what keys, if any, to bind them to by default. I'd suggest that we bind narrow-to-line to 'C-x n l', and leave mark-line unbound by default for now. > Here are some existing commands that are similar: > http://www.gnu.org/software/emacs/manual/html_node/emacs/Narrowing.html > http://www.gnu.org/software/emacs/manual/html_node/emacs/Marking-Objects.html Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 06 09:08:47 2019 Received: (at 20723) by debbugs.gnu.org; 6 Nov 2019 14:08:47 +0000 Received: from localhost ([127.0.0.1]:39633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSLzL-0004xF-BX for submit@debbugs.gnu.org; Wed, 06 Nov 2019 09:08:47 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:45320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSLzJ-0004wz-OG for 20723@debbugs.gnu.org; Wed, 06 Nov 2019 09:08:46 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xA6E49PR151478; Wed, 6 Nov 2019 14:08:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=1a86Rb0QWjeFJXJDswCBMToLE2xLmu0j5DLo99Ffj1Y=; b=q6gzSDJYGvmUHdybxgkq9ROO1rnw8/GqtEHapHBfJMqzhKxBMYjWPySPdVlftC5W22GY wte5WslXeEe58a6sNaiwFTqhBEs84ObJXEWUgrQM7Ysn98zR+QXVrr+ogYKiNbE1HqzA 1S7sTrUCMbtRfBQamO9DuprqyXs+GulbAKpPthOCXoZz26JyFlvemfbD1OI9NGHk77bF NIKMj+gv1SiOaYtOAyMYpuOE2P0zE1IcikXRiOqV4RKeUbXJ23DpVhpkIKUOTxa/lFQF Hd1z2jDyGd97SNc3a/KgsOitskWgce9m/oy9ktig2Amp3XU2sEu5WqHUM/DYCjlohUJ/ Rg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2w12erebtd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Nov 2019 14:08:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xA6E46JR196089; Wed, 6 Nov 2019 14:06:38 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2w3163k5qg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Nov 2019 14:06:38 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xA6E6ahs012584; Wed, 6 Nov 2019 14:06:36 GMT MIME-Version: 1.0 Message-ID: Date: Wed, 6 Nov 2019 06:06:35 -0800 (PST) From: Drew Adams To: Stefan Kangas Subject: RE: bug#20723: 24.4; narrow-to-line References: <87mud94v4y.fsf@marxist.se> In-Reply-To: <87mud94v4y.fsf@marxist.se> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4900.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9432 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=945 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911060139 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9432 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911060139 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20723 Cc: 20723@debbugs.gnu.org, Ed Avis 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.3 (---) > >> It would be handy to have M-x narrow-to-line to narrow the buffer to > >> the line point is currently on. >=20 > I think the proposal to add these commands make sense, since there > seems to exist a user demand. Would anyone object to including the > above commands in Emacs? >=20 > > The problem is what keys, if any, to bind them to by default. >=20 > I'd suggest that we bind narrow-to-line to 'C-x n l', and leave > mark-line unbound by default for now. I agree now with Ed Avis that we should _not_ bind either command to a key by default. Anyone who uses them can bind them to keys. These commands are not super-useful. There is no reason to sacrifice default keys to them. It's good to have such commands, but default keys should be defined only when we know there's a lot of clamor for them. ;-) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 06 09:15:02 2019 Received: (at 20723) by debbugs.gnu.org; 6 Nov 2019 14:15:02 +0000 Received: from localhost ([127.0.0.1]:39649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSM5O-00057z-9j for submit@debbugs.gnu.org; Wed, 06 Nov 2019 09:15:02 -0500 Received: from host.gofardesign.uk ([208.79.239.190]:47862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSM5M-00057U-77 for 20723@debbugs.gnu.org; Wed, 06 Nov 2019 09:15:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sGGj69xru+SLqt8zjAW49/rWqMiKhNZYOWIK8Ou8OzA=; b=IG7MCc0gdoh+hd4Nn3LsMDzPo6 DAkZHl6PUpkzDjcRin9kDVxNCCn/EKKEglSIzHEAID29yYEmcR95hrJsSvzg3WBo5RYz/2LKs6wqa vuO3oP6QhGoXy9CRBClSofhZYzdb+QSVSnAQWKn787ZEvyjX59brHTZ5q46fKUHe/oYU=; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:44608 helo=localhost) by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iSM5E-0007Hy-LW; Wed, 06 Nov 2019 08:14:53 -0600 From: Stefan Kangas To: Drew Adams Subject: Re: bug#20723: 24.4; narrow-to-line In-Reply-To: (Drew Adams's message of "Wed, 6 Nov 2019 06:06:35 -0800 (PST)") References: <87mud94v4y.fsf@marxist.se> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Date: Wed, 06 Nov 2019 15:14:50 +0100 Message-ID: <87ftj1xfad.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: host.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 20723 Cc: 20723@debbugs.gnu.org, Ed Avis 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 (-) Drew Adams writes: >> I'd suggest that we bind narrow-to-line to 'C-x n l', and leave >> mark-line unbound by default for now. > > I agree now with Ed Avis that we should _not_ bind > either command to a key by default. Anyone who > uses them can bind them to keys. > > These commands are not super-useful. There is no > reason to sacrifice default keys to them. It's > good to have such commands, but default keys > should be defined only when we know there's a lot > of clamor for them. ;-) That's fine by me. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 12:06:02 2022 Received: (at 20723) by debbugs.gnu.org; 29 Jan 2022 17:06:02 +0000 Received: from localhost ([127.0.0.1]:34635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDrAo-0003SH-5O for submit@debbugs.gnu.org; Sat, 29 Jan 2022 12:06:02 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDrAm-0003Rq-9d for 20723@debbugs.gnu.org; Sat, 29 Jan 2022 12:06:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AdeR+f3CYKGgorCx8u+CkYg5ruHrXozWOzrGTaBnd3k=; b=qTikND5UmRol0cC4c4SOOhbuJg i83r5fc4H5xr79jxwr8gWKJZ0MVbtg9mGkf1KvILEO3zphNJZzsSacwzErE1h8fViD6JCxHMYv1Yl GHPIe1z/hTO4BViKO6mSI4uewQfOYlYzUn+7ezQFvZF65Gm7o9JMsbwflM2R4uRQDcAk=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDrAa-0004r4-NR; Sat, 29 Jan 2022 18:05:51 +0100 From: Lars Ingebrigtsen To: Stefan Kangas Subject: Re: bug#20723: 24.4; narrow-to-line References: <87mud94v4y.fsf@marxist.se> X-Now-Playing: Depeche Mode's _Stripped_: "Breathing in fumes" Date: Sat, 29 Jan 2022 18:05:47 +0100 In-Reply-To: <87mud94v4y.fsf@marxist.se> (Stefan Kangas's message of "Wed, 06 Nov 2019 03:05:17 +0100") Message-ID: <875yq279qs.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: > I think the proposal to add these commands make sense, since there > seems to exist a user demand. Would anyone object to including the > above commands in Emacs? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20723 Cc: 20723@debbugs.gnu.org, Ed Avis , Drew Adams 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.3 (---) Stefan Kangas writes: > I think the proposal to add these commands make sense, since there > seems to exist a user demand. Would anyone object to including the > above commands in Emacs? In my opinion, they aren't generally useful enough either as commands (it's easier to just use the normal point movement and narrowing commands) or in code (narrowing to a line in code isn't very common), so I don't think it's worth adding these to Emacs, and I'm therefore closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 12:06:05 2022 Received: (at control) by debbugs.gnu.org; 29 Jan 2022 17:06:05 +0000 Received: from localhost ([127.0.0.1]:34638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDrAr-0003Sg-Fn for submit@debbugs.gnu.org; Sat, 29 Jan 2022 12:06:05 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDrAo-0003Rw-RS for control@debbugs.gnu.org; Sat, 29 Jan 2022 12:06:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mGQxxbgMSNnCKFBWfGKlbdlmcjnWUJ+y2ZfztjDfDBI=; b=t4afoWyfnR8ewplnXQ5EXHMnXu bLgOR8VdKMkvfqSXEtSgrjsAEO/GVPJWAMVNuMZf+yyXZZGCdZT41H9e7xG+2r5cn08W8zmd4w/Y2 pjbV85APUt/vDDrRYYNOLgxZLwMfIUfUk25naOioLGCpX0EGVlb4yNhIJUmVYmP7DPsU=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDrAh-0004r9-2a for control@debbugs.gnu.org; Sat, 29 Jan 2022 18:05:57 +0100 Date: Sat, 29 Jan 2022 18:05:54 +0100 Message-Id: <874k5m79ql.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #20723 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 20723 wontfix close 20723 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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.3 (---) tags 20723 wontfix close 20723 quit From unknown Sun Jun 22 22:42:23 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, 27 Feb 2022 12: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