emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp.el [lexbind]
Date: Tue, 06 Jul 2004 07:12:53 -0400

Index: emacs/lisp/emacs-lisp/lisp.el
diff -c emacs/lisp/emacs-lisp/lisp.el:1.46.4.5 
emacs/lisp/emacs-lisp/lisp.el:1.46.4.6
*** emacs/lisp/emacs-lisp/lisp.el:1.46.4.5      Sat May  1 23:46:16 2004
--- emacs/lisp/emacs-lisp/lisp.el       Tue Jul  6 09:23:44 2004
***************
*** 281,295 ****
            (end-of-defun)
            (point))))
        (t
!        ;; Do it in this order for the sake of languages with nested
!        ;; functions where several can end at the same place as with
!        ;; the offside rule, e.g. Python.
!        (push-mark (point))
!        (beginning-of-defun)
!        (push-mark (point) nil t)
!        (end-of-defun)
!        (exchange-point-and-mark)
!        (re-search-backward "^\n" (- (point) 1) t))))
  
  (defun narrow-to-defun (&optional arg)
    "Make text outside current defun invisible.
--- 281,311 ----
            (end-of-defun)
            (point))))
        (t
!        (let ((opoint (point))
!              beg end)
!          (push-mark opoint)
!          ;; Try first in this order for the sake of languages with nested
!          ;; functions where several can end at the same place as with
!          ;; the offside rule, e.g. Python.
!          (beginning-of-defun)
!          (setq beg (point))
!          (end-of-defun)
!          (setq end (point))
!          (while (looking-at "^\n")
!            (forward-line 1))
!          (if (> (point) opoint)
!              (progn
!                ;; We got the right defun.
!                (push-mark beg nil t)
!                (goto-char end)
!                (exchange-point-and-mark))
!            ;; beginning-of-defun moved back one defun
!            ;; so we got the wrong one.
!            (goto-char opoint)
!            (end-of-defun)
!            (push-mark (point) nil t)
!            (beginning-of-defun))
!          (re-search-backward "^\n" (- (point) 1) t)))))
  
  (defun narrow-to-defun (&optional arg)
    "Make text outside current defun invisible.
***************
*** 298,310 ****
    (interactive)
    (save-excursion
      (widen)
!     ;; Do it in this order for the sake of languages with nested
!     ;; functions where several can end at the same place as with the
!     ;; offside rule, e.g. Python.
!     (beginning-of-defun)
!     (let ((beg (point)))
        (end-of-defun)
!       (narrow-to-region beg (point)))))
  
  (defun insert-pair (arg &optional open close)
    "Enclose following ARG sexps in a pair of OPEN and CLOSE characters.
--- 314,341 ----
    (interactive)
    (save-excursion
      (widen)
!     (let ((opoint (point))
!         beg end)
!       ;; Try first in this order for the sake of languages with nested
!       ;; functions where several can end at the same place as with
!       ;; the offside rule, e.g. Python.
!       (beginning-of-defun)
!       (setq beg (point))
        (end-of-defun)
!       (setq end (point))
!       (while (looking-at "^\n")
!       (forward-line 1))
!       (unless (> (point) opoint)
!       ;; beginning-of-defun moved back one defun
!       ;; so we got the wrong one.
!       (goto-char opoint)
!       (end-of-defun)
!       (setq end (point))
!       (beginning-of-defun)
!       (setq beg (point)))
!       (goto-char end)
!       (re-search-backward "^\n" (- (point) 1) t)
!       (narrow-to-region beg end))))
  
  (defun insert-pair (arg &optional open close)
    "Enclose following ARG sexps in a pair of OPEN and CLOSE characters.




reply via email to

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