From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.bugs Subject: bug#10754: define-minor-mode and doc of derived mode Date: Fri, 29 Jun 2018 14:52:51 +0000 Message-ID: <87bmbty798.fsf@gmail.com> References: <87po12g7x4.fsf@gmail.com> <0edf0759-1044-4c6f-b70a-addebc9078f8@default> <87in6trm00.fsf@gmail.com> <83y3ffypek.fsf@gnu.org> <87fu1lv24d.fsf@gmail.com> <87d0wpurh5.fsf@gmail.com> <87bmc9uhl0.fsf@gmail.com> <87efh1xngb.fsf@gmail.com> <87vaa3zzsu.fsf@gmail.com> <87tvpnzzjr.fsf@gmail.com> <87d0w9yae0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530283875 10910 195.159.176.226 (29 Jun 2018 14:51:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Jun 2018 14:51:15 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: 10754@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 29 16:51:11 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYujv-0002kH-06 for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jun 2018 16:51:11 +0200 Original-Received: from localhost ([::1]:42757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYum2-0006gq-56 for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jun 2018 10:53:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYuln-0006cX-EE for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2018 10:53:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYuli-000363-Tr for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2018 10:53:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60329) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYuli-00035d-QR for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2018 10:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fYuli-0003ne-Iv for bug-gnu-emacs@gnu.org; Fri, 29 Jun 2018 10:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Shahid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jun 2018 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10754 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10754-submit@debbugs.gnu.org id=B10754.153028398114598 (code B ref 10754); Fri, 29 Jun 2018 14:53:02 +0000 Original-Received: (at 10754) by debbugs.gnu.org; 29 Jun 2018 14:53:01 +0000 Original-Received: from localhost ([127.0.0.1]:39993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYulh-0003nO-4i for submit@debbugs.gnu.org; Fri, 29 Jun 2018 10:53:01 -0400 Original-Received: from mail-qt0-f181.google.com ([209.85.216.181]:44518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYulf-0003nB-ER for 10754@debbugs.gnu.org; Fri, 29 Jun 2018 10:52:59 -0400 Original-Received: by mail-qt0-f181.google.com with SMTP id 92-v6so8032506qta.11 for <10754@debbugs.gnu.org>; Fri, 29 Jun 2018 07:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=0h4kc7X6nLvwinUtgrAFe3ortN7uWzjuEAiJXSaM/hI=; b=NWACx3mFgba7vKwNDx2gt0S0BfztOj9DEARHyNAMSPeR3rQl0v/H/NRn4QS5EhnU0o qcr94fJhsg5QU4gp/PI9ermcD937gKlCQ4dVFNn7UJMXbMqimpSomDuKrwmtikbZ76Fp HiWMipAzFMJzgU+FIANwVaL1qCUONoa0BQy02VHN7I87priAu/cfxkgN8z6mxeezqcVv NHub/OWfrB9Na/eAf3lSToroz3L9AQUGZ0MpYl1AoSp1buRtEL4IlWFZaEn8pTW9vqB4 tndHWxI0rgIU6JrZsJ4uC5Jt6NFlS5OjzraH3yCgwDLuw094q2GqlQA2KPVMzLB3UQcf ps+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=0h4kc7X6nLvwinUtgrAFe3ortN7uWzjuEAiJXSaM/hI=; b=tWmnArtwctX3zwt+Cdnp5CFxdvAoKZSQDnaMMpWRWJ6tF1yrXnes+fenlpdH/x11u8 643ec2xM42PHumM08YVA97kpEytrT9WBOrxcxbpRWr0VXImA9ejg0yLypjII0/cHto2g 2SQDxgJoAP/UR9kxtS/kAGl08jhN8Y6S1uFOALGqseXRXRPJHW7Veh62JtNpTD5Qst4w SQ1UEjn0QT8+lonFYMf4HmloGNlyMDeMqjFrodUVfuuegLNZfnuYR01PEjm05WPbtvp5 ZnQ+EqmgoUlTx6Ghyn5erGgNFm1v0Y8rElhBbO25c7rsQOIVszwzvrShzetAuSMR5ef2 e11g== X-Gm-Message-State: APt69E1ybKk3gaS+3BbHWcB22BqRRgs3wEd6zMUv8XB8185APxG7B1zB C34oycktCNi6hnrexin+WnY= X-Google-Smtp-Source: AAOMgpckrE2M0rAiVTZveoTP4k+1pm8Kc7uf4BzsYje0CA7tXRDRruxBfxVl8KSIUJtZwwcqRwNiTg== X-Received: by 2002:ac8:249:: with SMTP id o9-v6mr13957424qtg.355.1530283973653; Fri, 29 Jun 2018 07:52:53 -0700 (PDT) Original-Received: from 36032806ccb0 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id e63-v6sm7147876qkj.62.2018.06.29.07.52.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 07:52:52 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:147963 Archived-At: Stefan Monnier writes: >> Sounds reasonable, I was hesitant to make the implementation more >> complicated but it turns out not to be that bad. Attached the patch to >> either append the paragraph or insert it at the first empty line. > > Thanks, looks great to me. Thanks for taking a look. fyi, the current implementation replace the last "\n\n" instead of the first "\n\n". This is either a regression or a bug in the documentation of `replace-regexp-in-string'. The patch is doing the following expecting "doc" to appear between "foo" and "bar", but instead it is inserted between "bar" and "baz" (replace-regexp-in-string "\\(\n\n\\).*\\'" "\n\ndoc\\1" "foo\n\nbar\n\nbaz" nil nil 1) According to the doc ti should work: To replace only the first match (if any), make REGEXP match up to \' and replace a sub-expression, e.g. (replace-regexp-in-string "\\(foo\\).*\\'" "bar" " foo foo" nil nil 1) => " bar foo" I'm happy to open a new bug for this, but I don't think it is a blocker to merging this change.