;;
;;; Version:
-(defconst lj-version 1.27
+(defconst lj-version 1.28
"Version number of SXEmacs/LJ.")
;;; Code:
(lj-goto-subject)
(goto-char (point-at-eol))
(insert subject)
- (goto-char (point-max))))
+ (lj-goto-body)
+ (forward-line 2)))
(defun lj-narrow-to-qotd (qotd)
"Narrow Writer's Block buffer to a single QOTD."
(point-at-eol))
b (search-backward delim))
(narrow-to-region b e)
+ (recenter)
(shrink-window-if-larger-than-buffer)
(other-window 1)
(unless (eq major-mode 'lj-mode)
(switch-to-buffer "*LJ-Post*"))
(unless (zerop lj-qotd)
- (insert (format "<lj-template name=\"qotd\" id=\"%d\" />\n\n"
- lj-qotd))
+ (and (lj-goto-body)
+ (insert (format "<lj-template name=\"qotd\" id=\"%d\" />\n\n"
+ lj-qotd)))
(lj-qotd-subject lj-qotd))))
(defun lj-cleanup-qotd ()
(unless (eq major-mode 'lj-mode)
(switch-to-buffer "*LJ-Post*"))
(lj-cleanup-qotd)
- (and (lj-goto-subject)
- (kill-region (point) (point-at-eol)))
- (and (lj-goto-tags)
- (kill-region (point) (point-at-eol)))
+ (kill-region (lj-goto-subject) (point-at-eol))
+ (kill-region (lj-goto-tags) (point-at-eol))
(lj-goto-body)
(remove-hook 'lj-after-post-hook #'lj-cleanup-qotd))
(defun lj-writers-block ()
"Compose an answer to a LJ \"Writer's Block\" question."
(interactive)
- (and (lj-goto-subject)
- (kill-region (point) (point-at-eol))
+ (and (kill-region (lj-goto-subject) (point-at-eol))
(insert "Writer's Block: "))
- (and (lj-goto-tags)
- (kill-region (point) (point-at-eol))
+ (and (kill-region (lj-goto-tags) (point-at-eol))
(insert "writer's block"))
- (and (lj-goto-body)
- (kill-region (point) (point-max)))
+ (let ((b (lj-goto-body))
+ (e (or (and (goto-char (point-max))
+ (search-backward lj-signature nil t))
+ (point-max))))
+ (kill-region b e)
+ (insert "\n\n"))
(lj-sgml-indent-tab-or-complete)
(lj-parse-qotd-archive)
(pop-to-buffer lj-qotd-buffer)