From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#20723: 24.4; narrow-to-line Date: Tue, 2 Jun 2015 11:14:54 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1433268998 722 80.91.229.3 (2 Jun 2015 18:16:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jun 2015 18:16:38 +0000 (UTC) To: Ed Avis , 20723@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 02 20:16:22 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YzqjY-0003Hw-Ao for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jun 2015 20:16:16 +0200 Original-Received: from localhost ([::1]:60378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqjX-0004nA-K3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jun 2015 14:16:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqjP-0004g3-5y for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:16:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzqjL-0000Hy-2R for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:16:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqjK-0000Hp-QY for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YzqjK-0007yE-7q for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 14:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jun 2015 18:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20723 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20723-submit@debbugs.gnu.org id=B20723.143326890630571 (code B ref 20723); Tue, 02 Jun 2015 18:16:02 +0000 Original-Received: (at 20723) by debbugs.gnu.org; 2 Jun 2015 18:15:06 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103506 Archived-At: > 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