From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.help Subject: Re: Newline and copy above line's indentation Date: Tue, 03 Jul 2018 16:49:30 +0200 Message-ID: <87in5wqsqt.fsf@gmail.com> References: <86y3esh0w9.fsf@zoho.com> <86tvpggzc2.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530629306 30541 195.159.176.226 (3 Jul 2018 14:48:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Jul 2018 14:48:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 03 16:48:22 2018 Return-path: Envelope-to: geh-help-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 1faMbH-0007h5-6Q for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jul 2018 16:48:15 +0200 Original-Received: from localhost ([::1]:40857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faMdO-00033H-B7 for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jul 2018 10:50:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faMca-00031Y-Pv for help-gnu-emacs@gnu.org; Tue, 03 Jul 2018 10:49:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faMcX-00071q-Nu for help-gnu-emacs@gnu.org; Tue, 03 Jul 2018 10:49:36 -0400 Original-Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:42077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1faMcX-00071A-Er for help-gnu-emacs@gnu.org; Tue, 03 Jul 2018 10:49:33 -0400 Original-Received: by mail-wr0-x22b.google.com with SMTP id p1-v6so2272804wrs.9 for ; Tue, 03 Jul 2018 07:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:mail-copies-to:gmane-reply-to-list:date :in-reply-to:message-id:mime-version; bh=6G2Q1lhVYLv5JDhisNLwE+5oWJMiz3eVuSf0iwR4JTs=; b=K2lqc5bTfEh+/lP3Ed/n+2IMkVGn/3plDNhA8egSYFYTwcmIBOvsrQ2Z8ckv/4hkbg ut+vOUTnURv4UAzFGaRndR4iURQu0JmYI6bXUAq84K3G05HM2fHXJRYYCFRpxrAb5nmN 2mpCN0md4eBKthTUlTCy+t/fvTnahCBCSoA41B/wg/V5F41ej/FsgwNMz6dEckVo3FYv VsteLVXiIQcnlb5Op3Il4YlQ+V2I9ZMPXwBbSgJDi7y4xs4hmBgWoGipRKcsFtGRIby+ odc5x9G6zF2XzrPVL4gUy1FUyl7YxTgcQP9qCKqVrn7RBEY+XrBtOHac6Kr8ISwipWuY J0pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=6G2Q1lhVYLv5JDhisNLwE+5oWJMiz3eVuSf0iwR4JTs=; b=efzaoXP7D70IjJXsFzCZAJ1Mo89UY1ZYzjX9oEdHfxa445LwhbMgLyA+tl4h9l/kyt Cpeh2BXAcQc0wHYUKtVlv56pCtb+iYXnjMB7Kft7a/tJvqmvjeL2jCy62f8L+c9cLjRg +O515kvbnZc5uvyn0QuoPFjADTAffgYis7yT/3eWUXlPbpCPIjTK8UXSh/HZM+f2QNkZ vlgoO7grqxJmfZj38jJPX7qv4e1qMeDRO/In7Tg+nnBfJyw4CMWAT5YMJHV6pVOj+raM RhXTOYLvLw328v2b5CSTbO2xzUQT621y8VR0G0S2WQJ+WOjMAabvXQ1EJi2fYfNYjKGj K4Ig== X-Gm-Message-State: APt69E1oD4DRBo3l0hcp1WDrsEYdXiFWYzRNtbXY62CojX/5bMp8en6x eBJziNRj4O6enU+FYDna8t70TJLs1Jw= X-Google-Smtp-Source: AAOMgpdhhNN+IsiWsY/llXKNOqmWoNb3BXi6e2KHimIssnwsFUapPCVdWqpbivYGYC77HUc96K4nAA== X-Received: by 2002:adf:fe46:: with SMTP id m6-v6mr22201081wrs.171.1530629371905; Tue, 03 Jul 2018 07:49:31 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id s41-v6sm3001691wrc.5.2018.07.03.07.49.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 07:49:31 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <86tvpggzc2.fsf@zoho.com> (Emanuel Berg's message of "Tue, 03 Jul 2018 16:37:17 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22b X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117326 Archived-At: Emanuel Berg writes: > (defun copy-whitespace-above-and-indent-2 () > (interactive) > (let ((start) > (stop) ) > (save-excursion > (forward-line -1) > (setq start (point)) > (beginning-of-line-text) > (setq stop (point)) ) > (insert "\n" (buffer-substring start stop)) )) start == (point-at-bol). But it would be easier to just use 'indent-relative', which lots of modes already do. Robert