all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
Subject: Debugging abbrev-file
Date: Tue, 13 Jun 2006 14:30:24 +0200	[thread overview]
Message-ID: <e6n6mn$1r0$1@online.de> (raw)

;; Debugging abbrev-files turned out to be hairy
;;  sometimes.  As `define-abbrevs' stops while
;;  encountering an error, this function permits to
;;  jump just at the last messaged cursor position.

;; Probably there are more efficient ways to debug such
;; a file.  Please send your comments, alternatives
;; etc.

(defun define-abbrevs-localise (&optional arg)
  "As `define-abbrevs.' Messages `point' while processing
current visible buffer contents.
See documentation of `edit-abbrevs' for info on the format of the
text you must have in the buffer.
With argument, eliminate all abbrev definitions except
the ones defined from the buffer now."
  (interactive "P")
  (if arg (kill-all-abbrevs))
  (save-excursion
    (goto-char (point-min))
    (while (and (not (eobp)) (re-search-forward "^(" nil t))
      (let* ((buf (current-buffer))
             (table (read buf))
             abbrevs name hook exp count sys)
        (forward-line 1)
        (while (progn (forward-line 1)
                      (not (eolp)))
          (setq name (read buf) count (read buf))
          (if (equal count '(sys))
              (setq sys t count (read buf)))
          (setq exp (read buf))
          (skip-chars-backward " \t\n\f")
          (setq hook (if (not (eolp)) (read buf)))
          (skip-chars-backward " \t\n\f")
          ;; 2006-06-13 a.roehler@web.de changed section start
          (message "%s" (point))
          ;; 2006-06-13 a.roehler@web.de changed section end      
          (setq abbrevs (cons (list name exp hook count sys) abbrevs)))
        (define-abbrev-table table abbrevs)))))

__
Andreas Roehler

             reply	other threads:[~2006-06-13 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13 12:30 Andreas Roehler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-13 12:30 Debugging abbrev-file Andreas Roehler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='e6n6mn$1r0$1@online.de' \
    --to=andreas.roehler@online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.