emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] function for inserting a block


From: Nicolas Goaziou
Subject: Re: [O] function for inserting a block
Date: Sat, 14 Oct 2017 12:52:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hello,

Eric Abrahamsen <address@hidden> writes:

> How does this look?

Thank you! I have some questions and remarks.

> * etc/ORG-NEWS: Mention in news.

This doesn't need to be added to the commit message.

> +Do not be put off by having to remember the source block syntax.  Org mode
> +offers two ways of speeding up the creation of @samp{src} code blocks:

  src code blocks

is enough, IMO. There are may of them across the manual, and it just
makes reading more tedious.

> address@hidden org-insert-structure-template

I would also add

  @kindex C-c C-x t

> +  (let ((s (copy-marker (if (use-region-p)
> +                         (region-beginning)
> +                       (point))))

Does it really need to be a marker? AFAICT, nothing really changes this
position.

> +    (back-to-indentation)
> +    (insert (format "#+BEGIN_%s\n"
> +                 type))
> +    (indent-to column)

What about

  (beginning-of-line)
  (indent-to column)
  (insert (format "#+BEGIN_%s\n" type))

?

It avoids `back-to-indentation'.

> +    (if (bolp)
> +     (progn
> +       (skip-chars-backward " \n\t")
> +       (forward-char))
> +      (end-of-line)
> +      (insert "\n"))

I don't understand this part. In particular, the `forward-char' looks
wrong. Do you mean `forward-line' ? If so, do you handle the case where
buffer doesn't end with a newline character?

> +    (set-marker s nil)

See above.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]