Hello,

Matt Lundin <m...@imapmail.org> writes:

> -    (when (save-excursion (skip-chars-backward "*") (bolp))
> -      (forward-char))))
> +    (and (looking-at " ")
> +      (string-match "\\*+" (buffer-substring (point-at-bol) (point)))
> +      (forward-char))))

Please replace `and' with `when' if side-effects are involved.

Also, note that

  (save-excursion (skip-chars-backward "*") (bolp))

is faster and more accurate than

  (string-match "\\*+" (buffer-substring (point-at-bol) (point)))

because the latter matches, e.g.,

  ab*|c

where "|" is point.

Besides, I don't understand how this is related to empty headlines
since, AFAICT, this part of code is supposed to fix the issue on empty
headlines.

Regards,

-- 
Nicolas Goaziou

Reply via email to