From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: function for inserting a block Date: Fri, 20 Oct 2017 19:02:13 +0000 Message-ID: References: <877exghblx.fsf@ericabrahamsen.net> <87efromccg.fsf@nicolasgoaziou.fr> <87ziabepxt.fsf@ericabrahamsen.net> <87bmml2fb0.fsf@ericabrahamsen.net> <87fubuzpsa.fsf@nicolasgoaziou.fr> <874lsabdop.fsf@ericabrahamsen.net> <87vak1l11m.fsf@nicolasgoaziou.fr> <87r2uoc4q7.fsf@ericabrahamsen.net> <87bmllk5xy.fsf@nicolasgoaziou.fr> <878tgmwwsa.fsf@ericabrahamsen.net> <87po9q2e8k.fsf@nicolasgoaziou.fr> <87tvyyvpst.fsf@ericabrahamsen.net> <87fuaiz069.fsf@nicolasgoaziou.fr> <87lgk9eo4d.fsf@ericabrahamsen.net> <87fuahxxvs.fsf@nicolasgoaziou.fr> <87r2u1cuwj.fsf@ericabrahamsen.net> <87infdctzq.fsf@ericabrahamsen.net> <87k1zsbizs.fsf@ericabrahamsen.net> <87k1zp4rxj.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c13b50cf547d7055bff1c52" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5cYt-00062w-5C for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 15:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5cYr-0001C5-CN for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 15:02:26 -0400 Received: from mail-yw0-x22f.google.com ([2607:f8b0:4002:c05::22f]:50219) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5cYr-0001BR-8M for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 15:02:25 -0400 Received: by mail-yw0-x22f.google.com with SMTP id i198so7207698ywe.7 for ; Fri, 20 Oct 2017 12:02:25 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Eric Abrahamsen , emacs-orgmode@gnu.org --94eb2c13b50cf547d7055bff1c52 Content-Type: text/plain; charset="UTF-8" Also, if the type is "src", shouldn't the point end up after "#+BEGIN_SRC"? Because the user will anyways need to type something there. Finally, I am trying to understand what this does: (if (bolp) (progn (skip-chars-backward " \n\t") (forward-line)) ;; snip ) If the point is at BOL, wouldn't that progn bring the point exactly to where it was, as the same BOL? Also isn't that progn equivalent to (forward-line 0)? I am probably missing something.. but seems to work the same with (unless (bolp) (end-of-line) (insert "\n")) replacing that whole (if ..) form. -- Kaushal Modi --94eb2c13b50cf547d7055bff1c52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Also, if the type is "src", shouldn't the po= int end up after "#+BEGIN_SRC"? Because the user will anyways nee= d to type something there.

Finally, I am trying to under= stand what this does:

(if (bolp)
= =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 (skip-chars-backward &q= uot; \n\t")
=C2=A0 =C2=A0 =C2=A0 (forward-line))
= =C2=A0 ;; snip
=C2=A0 )

If the poi= nt is at BOL, wouldn't that progn bring the point exactly to where it w= as, as the same BOL? Also isn't that progn equivalent to (forward-line = 0)?

I am probably missing something.. but seems to= work the same with=C2=A0

(unless (bolp)
=C2=A0 =C2=A0 =C2=A0 (end-of-line)
=C2=A0 =C2=A0 =C2=A0 (in= sert "\n"))

replacing that whole (= if ..) form.
--

Kaushal Modi

--94eb2c13b50cf547d7055bff1c52--