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

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

bug#8615: Please make sure v q removes the buffer for JPGs just like it


From: Kevin Rodgers
Subject: bug#8615: Please make sure v q removes the buffer for JPGs just like it does for other files
Date: Tue, 13 Dec 2011 00:12:49 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.24) Gecko/20111103 Thunderbird/3.1.16

On 12/10/11 3:17 AM, jidanni@jidanni.org wrote:
Erg... this is what I have so far,

(eval-after-load "image-mode"
   '(progn
      (define-key image-mode-map "q"
        (lambda () (interactive) (quit-window (not 
current-prefix-arg))))));bug#8615
(eval-after-load "dired"
   '(progn
      (define-key dired-mode-map "q"
        (lambda () (interactive) (quit-window (not current-prefix-arg))))))
(eval-after-load "arc-mode"
   '(progn
      (define-key archive-mode-map "q";note the difference from the library name
        (lambda () (interactive) (quit-window (not current-prefix-arg))))))

i.e., an ever growing list. OK, I give up, you win. I'll use

(global-set-key [remap quit-window]
   (lambda () (interactive) (quit-window (not current-prefix-arg))))

But please tell me how to then restore the virgin "q" behavior for one or two
modes, e.g.,

(eval-after-load "compile"
   '(progn
      (define-key compilation-mode-map ... ???

I tired several things but nothing worked. Perhaps the "remap" above
ruined it for everything.

Just a guess, assuming that the original behavior is (quit-window current-prefix-arg):

(defvar remap-quit-window-exceptions '()
  "List of `major-mode' symbols in which `quit-window' should not be remapped.")

(global-set-key [remap quit-window]
   (lambda () (interactive)
     (if (memq major-mode remap-quit-window-exceptions)
         (quit-window current-prefix-arg)
       (quit-window (not current-prefix-arg)))))

;; (setq remap-quit-window-exceptions
;;       (cons 'compilation-mode remap-quit-window-exceptions))

--
Kevin Rodgers
Denver, Colorado, USA






reply via email to

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