help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs


From: Tassilo Horn
Subject: Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs
Date: Thu, 30 Aug 2007 09:51:55 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

Tassilo Horn <tassilo@member.fsf.org> writes:

> I think I have to create a function that changes to defparameter,
> evaluates the sexp and changes back to defvar...

Done!

--8<---------------cut here---------------start------------->8---
(defun th-eval-last-defvar-as-defparameter (ARG)
  "Eval the `defvar' before point as if it was a `defparameter'."
  (interactive "P")
  (save-excursion
    (let ((sexp (buffer-substring-no-properties
                 (point)
                 (progn
                   (backward-sexp)
                   (point)))))
      (with-temp-buffer
        (insert sexp)
        (goto-char (point-min))
        (condition-case nil
            (progn
              (search-forward "(defvar ")
              (replace-match "(defparameter ")
              (goto-char (point-max))
              (eval-last-sexp ARG))
          (error (message "The sexp before point must be a defvar
          form!")))))))
--8<---------------cut here---------------end--------------->8---

Now it's bound to `C-x C-v'.  Hopefully this was my last defparameter
checkin.

Bye,
Tassilo
-- 
People say that  if you play Microsoft CD's  backwards, you hear satanic
things,  but that's  nothing, because  if you  play them  forwards, they
install Windows.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]