all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Fabian Braennstroem <f.braennstroem@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: define tab for dired-buffer selection
Date: Sun, 16 Sep 2007 21:11:04 +0000	[thread overview]
Message-ID: <fcjv3q$31n$1@tamarack.fernuni-hagen.de> (raw)
In-Reply-To: <usl5j6ft2.fsf@gmail.com>

Hi Mathias,

sorry for the late response!

Mathias Dahl schrieb am 09/12/2007 03:53 PM:
> Fabian Braennstroem <f.braennstroem@gmx.de> writes:
> 
> 
>> My first approach was:
>> (defun dired-change-window()
>>   "Change to the other buffer"
>>   (interactive)
>>   (if (eq major-mode 'dired-mode) (other-window 1)
>>   (while (not (eq major-mode 'dired-mode)) (other-window 1))
>>        ))
> 
> This seems to work:
> 
> (defun dired-change-window()
>   "Change to the other buffer"
>   (interactive)
>   (if (eq major-mode 'dired-mode)
>       (select-window
>        (get-window-with-predicate
>         (lambda (x) 
>           (eq
>            (save-excursion (set-buffer (window-buffer x))
>                            major-mode)
>            'dired-mode))))))
> 
> I cannot say exactly why your code does not work though. Maybe the
> major-mode does not change because you never really changes buffers.

Thanks, it works well!
Fabian

      reply	other threads:[~2007-09-16 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-09 20:36 define tab for dired-buffer selection Fabian Braennstroem
2007-09-09 21:36 ` Peter Dyballa
     [not found] ` <mailman.591.1189373818.18990.help-gnu-emacs@gnu.org>
2007-09-10  6:26   ` Fabian Braennstroem
2007-09-12 15:53 ` Mathias Dahl
2007-09-16 21:11   ` Fabian Braennstroem [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='fcjv3q$31n$1@tamarack.fernuni-hagen.de' \
    --to=f.braennstroem@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.