mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 08:14:15 +00:00
Fix bug when buffer is empty
This commit is contained in:
parent
42b213de71
commit
bf2867688e
1 changed files with 10 additions and 9 deletions
|
|
@ -29,15 +29,16 @@
|
|||
(not (= self-chat-num self-chat-last)))
|
||||
(setq self-chat-last2 self-chat-last
|
||||
self-chat-last self-chat-num))
|
||||
;; Are we fixing up an old line, or creating a new one?
|
||||
(if (save-excursion
|
||||
(beginning-of-line)
|
||||
(not (looking-at (rx (+ nonl) ":"))))
|
||||
(progn
|
||||
(beginning-of-line)
|
||||
(kill-line))
|
||||
(call-interactively #'newline)
|
||||
(call-interactively #'newline))
|
||||
(unless (and (eobp) (bobp))
|
||||
;; Are we fixing up an old line, or creating a new one?
|
||||
(if (save-excursion
|
||||
(beginning-of-line)
|
||||
(not (looking-at (rx (+ nonl) ":"))))
|
||||
(progn
|
||||
(beginning-of-line)
|
||||
(kill-line))
|
||||
(call-interactively #'newline)
|
||||
(call-interactively #'newline)))
|
||||
(insert "> "))
|
||||
|
||||
(defun chat-post ()
|
||||
|
|
|
|||
Loading…
Reference in a new issue