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

Double Oops! 2 nd fix for lojban-lookup



The so called `fixed' copy of `lojban-reformat-lookup-buffer' I just
sent was the wrong one.  :-( :-(

It had the spelling error corrected but not the missing `forward-line'
nor the replacement for `looking-at-backward', which is part of my
personal environment but not a standard function.

Sorry about that.  This should work; I tried it with a completely
bland, standard, out of the box Emacs 18.57.

(defun lojban-reformat-lookup-buffer ()
  "Reformat the lookup buffer.  You may have to modify this."
  (forward-line 1)
  (while (not (eobp))
    (let ((here (point)))
      (delete-region (+ 30 here)  (+ 61 here)))
    ;; Fold long line
    (end-of-line)
    (while (> (current-column) 78)
      (move-to-column 72)
      (forward-word -1)
      ;; Replace missing `looking-at-backward' function.
      (if (let* ((begin (point))
                 (found (re-search-backward "\(" nil t)))
            (goto-char begin)
            (and found (= begin (match-end 0))))
          (forward-char -1))
      (insert "\n                                    "))
    (forward-line 1)))