From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 06 11:22:47 2017 Received: (at submit) by debbugs.gnu.org; 6 Aug 2017 15:22:47 +0000 Received: from localhost ([127.0.0.1]:44870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deNOB-0000RY-Fz for submit@debbugs.gnu.org; Sun, 06 Aug 2017 11:22:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deNO8-0000RH-VX for submit@debbugs.gnu.org; Sun, 06 Aug 2017 11:22:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deNO2-0001nC-HQ for submit@debbugs.gnu.org; Sun, 06 Aug 2017 11:22:39 -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.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]:40326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1deNO2-0001n5-Em for submit@debbugs.gnu.org; Sun, 06 Aug 2017 11:22:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deNO1-0001tQ-0q for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 11:22:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deNNx-0001ko-Sm for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 11:22:37 -0400 Received: from mout.gmx.net ([212.227.15.18]:49691) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1deNNx-0001k4-Fs for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 11:22:33 -0400 Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MY7ZA-1e9Bvp1c3c-00UuXU for ; Sun, 06 Aug 2017 17:22:29 +0200 Date: Sun, 6 Aug 2017 11:22:20 -0400 From: Boruch Baum To: Emacs Bug Reporting Subject: [25.2] delete-indentation: restore correct point (and..) [PATCH INCLUDED] Message-ID: <20170806152220.jtziel2qf6swtce5@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5ijnmfhkk2f6cfvj" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20170609 (1.8.3) X-Provags-ID: V03:K0:02UoSxg5wDyPpfPxqx4GvWD42aH6Ro2iC67oISK1BJln5ZV0uj/ QfpC0jWoAmFfXsa5iYheK05f9WavjQRtfL85NFAY3wW9UkAoVmMnFgN4Daw6nboUTumsZBu X9F64mUWFjtGw3eW79R1IDIPJC6plqKaR44mwBLpmBgSJ8rLFsG379RzR1f2a0I4LSN6QSb 4kIeKrbxy9o8yjoUSRtCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:upaUzKcEMTM=:1TThWF/QfSvxhO2P1aNfn9 X6qcDd1sYr2c2Nn7fhcwkdHRb/X8y54mwJe5y2r3h1Q90dH83WCuQeOrTr9EVs2GDufwh4Knd ceGHpzsx+5JttEn+Gil9qrfl4FktRitifKFS73AVQ94phYtx+r3MVIHF2resqzDfOhYGx3q7g WjID4gXlv7IGk2qUUfUuINjUfrHxyPxXBMJOzWKsdONspHQG6AsQmtwRFX7/X63Yfglfwbsls zO0Q3Qb662G9p3DsA9Nj42Q9/s+uzJ2Y2+gZizXhuymtoP+kWFZp9bitCyQ94XgvAe8438M+E fIOgj47UFDHvDOargZZfgFEa1Ua6U6073mnnWyKVrvRhTTICsokdGWSRDzcdXU1n1ATDNfPHd SKI6XLwmOyZO//Z87c8erDc0owhrfho3Hc5kXfodGkS7Aa0o5S11vhvwnAtdC3EMznyl9IEcP MBlYxLL61QNXj9tsP+BMpv2WlT80P3hrfDp5ewAh9n035iWwwrWjn7d8IlabqbO4nzHvZFUXd qWCDgEE8UM8Mh895/tct3WQEGsUIW15u27DLXmC4vBgHFtEwSbws5OZK3gvBO10RZAyi8s2uA 9135sj+Z/VXOV+gngr+hlDgIArmgLHVHTMiwmCiVtPAB2OOVlPbrlSTI480Yl/HYcLvJ+289K eBL6DLoyGNal8uAX7Saow+Aj292LVfEc7lHztxOjUcUWjMZ1ttWH0KlVSPd6pddEUu83mRXpA Rfn0pMd3sZ3ggNRUYuC8tYg5EiiBkpkEGbzbY6NrXiqMVodX3F/ScfGJsB/8ienb9btAGTiZk VISChDUoxylfOZsjaANuMIdxUROsA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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.4 (---) X-Debbugs-Envelope-To: submit 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.4 (---) --5ijnmfhkk2f6cfvj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.16) of 2017-07-11, modified by Debian 1] Function `delete-indentation' does not preserve point. The attached patch fixes that for joining lines both forward and backward. 2] Also included is a wrapper function, `my-join-lines' that I'd like to propose be included in emacs. 2.1] The wrapper function adds the ability to: 2.1.1] Act on regions; 2..1.2] Accept a numeric prefix argument for the number of lines to join in either direction. 2.2] Lines of the wrapper function annotated on the right with the string `; ┃' are only necessary if the proposed patch to function `delete-indentation' is rejected. -- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --5ijnmfhkk2f6cfvj Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename="delete-indentations.patch" Content-Transfer-Encoding: 8bit (defun delete-indentation (&optional arg) "Join this line to previous and fix up whitespace at join. If there is a fill prefix, delete it from the beginning of this line. With argument, join this line to following line." (interactive "*P") (let ((return-point (point)) (return-col (if (not arg) (- (point-at-eol) (point))))) (beginning-of-line) (if arg (forward-line 1)) (if (eq (preceding-char) ?\n) (progn (delete-region (point) (1- (point))) ;; If the second line started with the fill prefix, ;; delete the prefix. (if (and fill-prefix (<= (+ (point) (length fill-prefix)) (point-max)) (string= fill-prefix (buffer-substring (point) (+ (point) (length fill-prefix))))) (delete-region (point) (+ (point) (length fill-prefix)))) (fixup-whitespace) (if return-col (goto-char (- (point-at-eol) return-col)) (goto-char return-point)))))) (defun my-join-lines (&optional arg) "Join multiple lines, forward or backwards. By default, joins forward one line (the standard `join-lines', an alias for `delete-indentation', and bound by default to M-^, joins backward by default). With a prefix argument joins that number of lines in +/- direction. With a region selected, joins all lines in the region." (interactive "p") (let ((return-point (point)) ; ┃ return-col) ; ┃ (if (use-region-p) (let ((begin (region-beginning))) (when (= (point) (region-end)) ; ┃ (setq return-col (- (point-at-eol) (point)))) ; ┃ (goto-char (region-end)) (while (> (point-at-bol) begin) (join-line))) (if arg (if (> arg 0) (dotimes (i arg) (join-line t)) (setq return-col (- (point-at-eol) (point))) ; ┃ (dotimes (i (- 0 arg)) (join-line))) (join-line t))) (if return-col ; ┃ (goto-char (- (point-at-eol) return-col)) ; ┃ (goto-char return-point)))) ; ┃ --5ijnmfhkk2f6cfvj-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 12:20:37 2019 Received: (at 27985) by debbugs.gnu.org; 24 Jun 2019 16:20:37 +0000 Received: from localhost ([127.0.0.1]:57752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfRht-0006TK-BC for submit@debbugs.gnu.org; Mon, 24 Jun 2019 12:20:37 -0400 Received: from quimby.gnus.org ([80.91.231.51]:32956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfRhr-0006TA-NA for 27985@debbugs.gnu.org; Mon, 24 Jun 2019 12:20:36 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfRhn-0005GH-8D; Mon, 24 Jun 2019 18:20:33 +0200 From: Lars Ingebrigtsen To: Boruch Baum Subject: Re: bug#27985: [25.2] delete-indentation: restore correct point (and..) [PATCH INCLUDED] References: <20170806152220.jtziel2qf6swtce5@E15-2016.optimum.net> Date: Mon, 24 Jun 2019 18:20:31 +0200 In-Reply-To: <20170806152220.jtziel2qf6swtce5@E15-2016.optimum.net> (Boruch Baum's message of "Sun, 6 Aug 2017 11:22:20 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Boruch Baum writes: > 1] Function `delete-indentation' does not preserve point. The attached > patch fixes that for joining lines both forward and backward. I tested the command now, and it seems like it now preserves point. But it's been completely rewritten from when this bug report was written... 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: 0.0 (/) X-Debbugs-Envelope-To: 27985 Cc: 27985@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: -1.0 (-) Boruch Baum writes: > 1] Function `delete-indentation' does not preserve point. The attached > patch fixes that for joining lines both forward and backward. I tested the command now, and it seems like it now preserves point. But it's been completely rewritten from when this bug report was written... > 2] Also included is a wrapper function, `my-join-lines' that I'd like to > propose be included in emacs. > > 2.1] The wrapper function adds the ability to: > > 2.1.1] Act on regions; > > 2..1.2] Accept a numeric prefix argument for the number of lines to join > in either direction. > > 2.2] Lines of the wrapper function annotated on the right with the > string `; =E2=94=83' are only necessary if the proposed patch to function > `delete-indentation' is rejected. Looking at the new implementation, it seems like it does most of this now, including the region stuff, so I'm closing this bug report. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 12:20:45 2019 Received: (at control) by debbugs.gnu.org; 24 Jun 2019 16:20:45 +0000 Received: from localhost ([127.0.0.1]:57755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfRi0-0006Tl-Mx for submit@debbugs.gnu.org; Mon, 24 Jun 2019 12:20:45 -0400 Received: from quimby.gnus.org ([80.91.231.51]:32970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfRhx-0006Ta-LE for control@debbugs.gnu.org; Mon, 24 Jun 2019 12:20:43 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfRhv-0005GO-4r for control@debbugs.gnu.org; Mon, 24 Jun 2019 18:20:41 +0200 Date: Mon, 24 Jun 2019 18:20:39 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #27985 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: close 27985 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: 0.0 (/) 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: -1.0 (-) close 27985 quit From unknown Sun Jun 22 17:13:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 23 Jul 2019 11:24:12 +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