1

When I click a file in a directory buffer, I would like it to open in a new tab instead of splitting the current tab.

Note that Options->Show Tabs is selected.

Using version

Aquamacs 3.0preview4 GNU Emacs 24.3.50.2 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00) of 2013-12-31 (Aquamacs-3.0preview3-32-gc3bb9a0-dirty) on watson.local

dima_b
  • 133
  • 5

1 Answers1

1

Aquamacs has a million things that are customized based upon the developer's decisions, and I haven't spent time with Aquamacs for several months now. Here is something that works with a generic version of Emacs -- the key binding is Control+c f

If it doesn't work for you, let me know what's happening and I'll see if I can figure it out.

EDIT (January 6, 2014):  First working draft.

EDIT (January 13, 2014):  Added the missing portion of the code relating to the variable path.

(define-key dired-mode-map (kbd "C-c f") (lambda () (interactive)
  (let* (
    (input-filename
      (if
          (or (re-search-backward "^*" nil t)
            (re-search-forward "^*" nil t))
      (dired-get-marked-files)
      (dired-get-file-for-visit)))
    (path (if (stringp input-filename)(file-name-directory input-filename))))
    (cond
      ((and
          (stringp input-filename)
          (not (file-directory-p input-filename))
          (file-exists-p input-filename)
          (not (equal input-filename (concat path "."))))
        (find-file input-filename))
      ((listp input-filename)
        (mapc 'find-file input-filename))))))
lawlist
  • 13,099
  • 3
  • 49
  • 158