emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el
Date: Sat, 01 Jan 2005 20:47:19 -0500

Index: emacs/lisp/files.el
diff -c emacs/lisp/files.el:1.738 emacs/lisp/files.el:1.739
*** emacs/lisp/files.el:1.738   Fri Dec 31 14:48:12 2004
--- emacs/lisp/files.el Sun Jan  2 01:20:33 2005
***************
*** 1,7 ****
  ;;; files.el --- file input and output commands for Emacs
  
! ;; Copyright (C) 1985,86,87,92,93,94,95,96,97,98,99,2000,01,02,03,2004
! ;;;   Free Software Foundation, Inc.
  
  ;; Maintainer: FSF
  
--- 1,7 ----
  ;;; files.el --- file input and output commands for Emacs
  
! ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
! ;;   1999, 2000, 2001, 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
  
  ;; Maintainer: FSF
  
***************
*** 2218,2248 ****
                                                   buffer-file-name)
                                                (concat "buffer "
                                                        (buffer-name))))))))))
!         (let (prefix suffix beg
!               (enable-local-eval enable-local-eval))
!           ;; The prefix is what comes before "local variables:" in its line.
!           ;; The suffix is what comes after "local variables:" in its line.
!           (skip-chars-forward " \t")
!           (or (eolp)
!               (setq suffix (buffer-substring (point)
!                                              (progn (end-of-line) (point)))))
!           (goto-char (match-beginning 0))
!           (or (bolp)
!               (setq prefix
!                     (buffer-substring (point)
!                                       (progn (beginning-of-line) (point)))))
  
-           (setq prefix (if prefix (regexp-quote prefix) "^"))
-           (if suffix (setq suffix (concat (regexp-quote suffix) "$")))
            (forward-line 1)
            (let ((startpos (point))
                  endpos
                  (thisbuf (current-buffer)))
              (save-excursion
                (if (not (re-search-forward
!                         (concat (or prefix "")
!                                 "[ \t]*End:[ \t]*"
!                                 (or suffix ""))
                          nil t))
                    (error "Local variables list is not properly terminated"))
                (beginning-of-line)
--- 2218,2244 ----
                                                   buffer-file-name)
                                                (concat "buffer "
                                                        (buffer-name))))))))))
!         (skip-chars-forward " \t")
!         (let ((enable-local-eval enable-local-eval)
!               ;; suffix is what comes after "local variables:" in its line.
!               (suffix
!                (concat
!                 (regexp-quote (buffer-substring (point) (line-end-position)))
!                 "$"))
!               ;; prefix is what comes before "local variables:" in its line.
!               (prefix
!                (concat "^" (regexp-quote
!                             (buffer-substring (line-beginning-position)
!                                               (match-beginning 0)))))
!               beg)
  
            (forward-line 1)
            (let ((startpos (point))
                  endpos
                  (thisbuf (current-buffer)))
              (save-excursion
                (if (not (re-search-forward
!                         (concat prefix "[ \t]*End:[ \t]*" suffix)
                          nil t))
                    (error "Local variables list is not properly terminated"))
                (beginning-of-line)
***************
*** 2251,2270 ****
              (with-temp-buffer
                (insert-buffer-substring thisbuf startpos endpos)
                (goto-char (point-min))
!               (subst-char-in-region (point) (point-max)
!                                     ?\^m ?\n)
                (while (not (eobp))
!                 ;; Discard the prefix, if any.
!                 (if prefix
!                     (if (looking-at prefix)
!                         (delete-region (point) (match-end 0))
!                       (error "Local variables entry is missing the prefix")))
                  (end-of-line)
!                 ;; Discard the suffix, if any.
!                 (if suffix
!                     (if (looking-back suffix)
!                         (delete-region (match-beginning 0) (point))
!                       (error "Local variables entry is missing the suffix")))
                  (forward-line 1))
                (goto-char (point-min))
  
--- 2247,2263 ----
              (with-temp-buffer
                (insert-buffer-substring thisbuf startpos endpos)
                (goto-char (point-min))
!               (subst-char-in-region (point) (point-max) ?\^m ?\n)
                (while (not (eobp))
!                 ;; Discard the prefix.
!                 (if (looking-at prefix)
!                     (delete-region (point) (match-end 0))
!                   (error "Local variables entry is missing the prefix"))
                  (end-of-line)
!                 ;; Discard the suffix.
!                 (if (looking-back suffix)
!                     (delete-region (match-beginning 0) (point))
!                   (error "Local variables entry is missing the suffix"))
                  (forward-line 1))
                (goto-char (point-min))
  




reply via email to

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