From 53ad7bee3f4fe36f65121a69857b016a02aca7f7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 12 Feb 2008 21:20:05 +0000 Subject: [PATCH] Fix broken indentation. (tar-mouse-extract, tar-extract, tar-subfile-save-buffer): Use with-current-buffer. --- lisp/ChangeLog | 6 ++++++ lisp/tar-mode.el | 54 +++++++++++++++++++++--------------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b1391a5f57..aef928f431d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-02-12 Stefan Monnier + + * tar-mode.el: Fix broken indentation. + (tar-mouse-extract, tar-extract, tar-subfile-save-buffer): + Use with-current-buffer. + 2008-02-12 Juanma Barranquero * hexl.el (hexl-mode): Don't make `font-lock-defaults' buffer-local; diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index ed974160382..8df1231d96c 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -498,50 +498,50 @@ is visible (and the real data of the buffer is hidden)." (define-key map "M" 'tar-chmod-entry) (define-key map "G" 'tar-chgrp-entry) (define-key map "O" 'tar-chown-entry) - + ;; Make menu bar items. ;; Get rid of the Edit menu bar item to save space. (define-key map [menu-bar edit] 'undefined) (define-key map [menu-bar immediate] - (cons "Immediate" (make-sparse-keymap "Immediate"))) + (cons "Immediate" (make-sparse-keymap "Immediate"))) (define-key map [menu-bar immediate view] - '("View This File" . tar-view)) + '("View This File" . tar-view)) (define-key map [menu-bar immediate display] - '("Display in Other Window" . tar-display-other-window)) + '("Display in Other Window" . tar-display-other-window)) (define-key map [menu-bar immediate find-file-other-window] - '("Find in Other Window" . tar-extract-other-window)) + '("Find in Other Window" . tar-extract-other-window)) (define-key map [menu-bar immediate find-file] - '("Find This File" . tar-extract)) + '("Find This File" . tar-extract)) (define-key map [menu-bar mark] - (cons "Mark" (make-sparse-keymap "Mark"))) + (cons "Mark" (make-sparse-keymap "Mark"))) (define-key map [menu-bar mark unmark-all] - '("Unmark All" . tar-clear-modification-flags)) + '("Unmark All" . tar-clear-modification-flags)) (define-key map [menu-bar mark deletion] - '("Flag" . tar-flag-deleted)) + '("Flag" . tar-flag-deleted)) (define-key map [menu-bar mark unmark] - '("Unflag" . tar-unflag)) + '("Unflag" . tar-unflag)) (define-key map [menu-bar operate] - (cons "Operate" (make-sparse-keymap "Operate"))) + (cons "Operate" (make-sparse-keymap "Operate"))) (define-key map [menu-bar operate chown] - '("Change Owner..." . tar-chown-entry)) + '("Change Owner..." . tar-chown-entry)) (define-key map [menu-bar operate chgrp] - '("Change Group..." . tar-chgrp-entry)) + '("Change Group..." . tar-chgrp-entry)) (define-key map [menu-bar operate chmod] - '("Change Mode..." . tar-chmod-entry)) + '("Change Mode..." . tar-chmod-entry)) (define-key map [menu-bar operate rename] - '("Rename to..." . tar-rename-entry)) + '("Rename to..." . tar-rename-entry)) (define-key map [menu-bar operate copy] - '("Copy to..." . tar-copy)) + '("Copy to..." . tar-copy)) (define-key map [menu-bar operate expunge] - '("Expunge Marked Files" . tar-expunge)) - + '("Expunge Marked Files" . tar-expunge)) + map) "Local keymap for Tar mode listings.") @@ -678,8 +678,7 @@ appear on disk when you save the tar-file's buffer." (defun tar-mouse-extract (event) "Extract a file whose tar directory line you click on." (interactive "e") - (save-excursion - (set-buffer (window-buffer (posn-window (event-end event)))) + (with-current-buffer (window-buffer (posn-window (event-end event))) (save-excursion (goto-char (posn-point (event-end event))) ;; Just make sure this doesn't get an error. @@ -721,8 +720,7 @@ appear on disk when you save the tar-file's buffer." undo-list) (unless buffer (setq buffer (generate-new-buffer bufname)) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (setq undo-list buffer-undo-list buffer-undo-list t)) (setq bufname (buffer-name buffer)) @@ -751,13 +749,11 @@ appear on disk when you save the tar-file's buffer." (setq coding (detect-coding-region start end t))) (if (and default-enable-multibyte-characters (coding-system-get coding :for-unibyte)) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (set-buffer-multibyte nil))) (widen) (decode-coding-region start end coding buffer) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (goto-char (point-min)) (setq buffer-file-name new-buffer-file-name) (setq buffer-file-truename @@ -768,8 +764,7 @@ appear on disk when you save the tar-file's buffer." ;; Set the default-directory to the dir of the ;; superior buffer. (setq default-directory - (save-excursion - (set-buffer tar-buffer) + (with-current-buffer tar-buffer default-directory)) (normal-mode) ; pick a mode. (rename-buffer bufname) @@ -1138,8 +1133,7 @@ to make your changes permanent." (delete-region (point-min) (point-max)) ;; insert the new data... (goto-char data-start) - (save-excursion - (set-buffer subfile) + (with-current-buffer subfile (save-restriction (widen) (encode-coding-region 1 (point-max) coding tar-superior-buffer))) -- 2.39.5