[Top][All Lists]

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

Re: TAB for non-editing modes

From: Juri Linkov
Subject: Re: TAB for non-editing modes
Date: Mon, 24 Sep 2007 02:59:36 +0300
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> - `TAB' is used for indenting, which can be context-dependent. Someday
> perhaps we will have a notion of indenting for Dired. (No idea what such
> indentation might mean - perhaps for inserted subdirs?)
> - `TAB' is used for completion - both minibuffer and buffer text. Someday
> perhaps we will have some notion of "completing" a file or directory entry
> in Dired. (No idea what such completion might mean.)

FWIW, I use a combination of two functionalities with the same TAB key.
If TAB is typed on a symbol, then it is used for completion.  Otherwise -
for indenting:

(defun my-lisp-indent-or-complete ()
  (if (and (memq (char-syntax (preceding-char)) (list ?w ?_)) (not (bobp)))
(define-key emacs-lisp-mode-map [tab] 'my-lisp-indent-or-complete)

This even works without a modification with the latest changes Dan made
to use TAB to indent the active region.

> - `TAB' is used for field navigation (particularly outside Emacs), as
> Lennart mentioned. Someday perhaps we will have fields of some sort in
> Dired.

I've TAB bound in dired to the command that navigates to the next/previous
directory, and I find this useful:

(defun my-dired-move-to-next-dir (arg)
  (interactive "P")
  (if (not (memq ?R (append dired-actual-switches nil)))
      (dired-next-dirline-cycle 1)
    (progn (dired-next-subdir 1))))
(define-key dired-mode-map [tab] 'my-dired-move-to-next-dir)

Another good binding for TAB in dired would be `other-window' like it is
used in most commander-like file managers to switch to another file panel.
I tried this once but have found that this is useful only in a
configuration where both Emacs windows contain dired buffers.
However, a habit of using TAB to switch between dired buffers fails
when one of dired buffers gets replaced with a visited file, and typing
TAB in a file buffer doesn't switch back to the dired buffer in another
window, because TAB has another binding in the file buffer.

> I'm not familiar with wdired, but perhaps it has such a notion of field, so
> that some editing commands get their specific effect from the kind of field
> the cursor is in. I don't know. In that case, letting `TAB' move among
> fields might be useful.

Yes, wdired has editable fields where TAB would be useful, but wdired is
a separate mode, so this fact is irrelevant here.

Juri Linkov

reply via email to

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