emacs-bug-tracker
[Top][All Lists]
Advanced

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

[Emacs-bug-tracker] bug#5513: marked as done (Archives disregard special


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#5513: marked as done (Archives disregard special mode-class)
Date: Sun, 18 Apr 2010 23:55:02 +0000

Your message dated Mon, 19 Apr 2010 02:52:57 +0300
with message-id <address@hidden>
and subject line Re: bug#5513: Archives disregard special mode-class
has caused the GNU bug report #5513,
regarding Archives disregard special mode-class
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact address@hidden
immediately.)


-- 
5513: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5513
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Archives disregard special mode-class Date: Wed, 03 Feb 2010 01:27:46 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (x86_64-pc-linux-gnu)
Visiting a file from an archive activates view-mode even when its major
mode has the property `mode-class' equal to `special'.  For instance,
visiting a .jar archive from .xpi archives or from .tar archives.
(See also bug#4896 for more information.)

This patch takes into account the special mode-class property
and doesn't activate view-mode in this case:

=== modified file 'lisp/arc-mode.el'
--- lisp/arc-mode.el    2010-02-01 23:02:47 +0000
+++ lisp/arc-mode.el    2010-02-02 23:10:14 +0000
@@ -1057,8 +1057,16 @@ (defun archive-extract (&optional other-
        (archive-maybe-update t))
       (or (not (buffer-name buffer))
           (cond
-           (view-p (view-buffer
-                   buffer (and just-created 'kill-buffer-if-not-modified)))
+           (view-p
+           ;; FIXME: code duplicated from `view-file', perhaps the test for 
special
+           ;; mode-class should be moved from `view-file' to `view-buffer'.
+           (if (eq (with-current-buffer buffer
+                     (get major-mode 'mode-class))
+                   'special)
+               (progn
+                 (switch-to-buffer buffer)
+                 (message "Not using View mode because the major mode is 
special"))
+             (view-buffer buffer (and just-created 
'kill-buffer-if-not-modified))))
            ((eq other-window-p 'display) (display-buffer buffer))
            (other-window-p (switch-to-buffer-other-window buffer))
            (t (switch-to-buffer buffer))))))

=== modified file 'lisp/tar-mode.el'
--- lisp/tar-mode.el    2010-01-13 08:35:10 +0000
+++ lisp/tar-mode.el    2010-01-31 20:06:55 +0000
@@ -852,14 +852,23 @@ (defun tar-extract (&optional other-wind
           (set (make-local-variable 'tar-superior-descriptor) descriptor)
           (setq buffer-read-only read-only-p)
           (tar-subfile-mode 1)))
-      (if view-p
-         (view-buffer
-          buffer (and just-created 'kill-buffer-if-not-modified))
-       (if (eq other-window-p 'display)
-           (display-buffer buffer)
-         (if other-window-p
-             (switch-to-buffer-other-window buffer)
-           (switch-to-buffer buffer)))))))
+      (cond
+       (view-p
+       ;; FIXME: code duplicated from `view-file', perhaps the test for special
+       ;; mode-class should be moved from `view-file' to `view-buffer'.
+       (if (eq (with-current-buffer buffer
+                 (get major-mode 'mode-class))
+               'special)
+           (progn
+             (switch-to-buffer buffer)
+             (message "Not using View mode because the major mode is special"))
+         (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))))
+       ((eq other-window-p 'display)
+       (display-buffer buffer))
+       (other-window-p
+       (switch-to-buffer-other-window buffer))
+       (t
+       (switch-to-buffer buffer))))))
 
 
 (defun tar-extract-other-window ()

-- 
Juri Linkov
http://www.jurta.org/emacs/




--- End Message ---
--- Begin Message --- Subject: Re: bug#5513: Archives disregard special mode-class Date: Mon, 19 Apr 2010 02:52:57 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)
>> I think in the long run the correct behavior of `view-buffer' should be to
>> check `mode-class'.  Instead of switching the behavior after the release,
>> we could wait and install the final version of `view-buffer' (that checks for
>> `mode-class') after feature freeze (or install now to the `pending' branch).
>
> Fine by me,

Done.

-- 
Juri Linkov
http://www.jurta.org/emacs/


--- End Message ---

reply via email to

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