From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#16214: Consistency in dired-, occur-, and grep-mode Date: Wed, 25 Dec 2013 08:15:39 +0900 (JST) Message-ID: <20131225.081539.476633610.tkk@misasa.okayama-u.ac.jp> References: <87ppoo8srl.fsf@mail.jurta.org> <20131223.203459.187619082.tkk@misasa.okayama-u.ac.jp> <87fvpj5voe.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1387926973 27227 80.91.229.3 (24 Dec 2013 23:16:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2013 23:16:13 +0000 (UTC) Cc: 16214@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp, josh@foxtail.org, roland@hack.frob.com To: juri@jurta.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 25 00:16:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VvbD0-0003dq-I3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 00:16:18 +0100 Original-Received: from localhost ([::1]:40653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvbCz-0007b2-RT for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 18:16:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvbCr-0007aq-8r for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 18:16:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VvbCl-0005x1-1M for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 18:16:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvbCk-0005wx-To for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 18:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VvbCj-0002AA-OK for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2013 18:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2013 23:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16214 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16214-submit@debbugs.gnu.org id=B16214.13879269528294 (code B ref 16214); Tue, 24 Dec 2013 23:16:01 +0000 Original-Received: (at 16214) by debbugs.gnu.org; 24 Dec 2013 23:15:52 +0000 Original-Received: from localhost ([127.0.0.1]:39883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvbCX-00029g-I6 for submit@debbugs.gnu.org; Tue, 24 Dec 2013 18:15:50 -0500 Original-Received: from msmail2.misasa.okayama-u.ac.jp ([150.46.245.7]:44604 helo=msmail.misasa.okayama-u.ac.jp) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvbCT-00029Q-Gs for 16214@debbugs.gnu.org; Tue, 24 Dec 2013 18:15:47 -0500 Original-Received: from localhost (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by msmail.misasa.okayama-u.ac.jp (Postfix) with ESMTP id 4466EAF8094; Wed, 25 Dec 2013 08:15:43 +0900 (JST) In-Reply-To: <87fvpj5voe.fsf@mail.jurta.org> X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82554 Archived-At: >> Assigning to (open-file-this-window) on occur/grep may loose >> convenience, but helps new users because that behavior is similar to >> following hyperlink in a web browser. > > This behavior is similar to using History or Bookmarks window > in a web browser. I see the analogy of behavior in occur/grep as a sidebar. Then dired is shown on the main window of the web browser watching directory structure of a web server. >> A. edit-buffer >> To avoid overwriting `e' in dired, it seems that `C-x C-q' is the >> second choice. Is `M-e' or `M-g e' better? > > Adding a new key is not better because it will be incompatible > with older versions. How about to add `E' to edit buffer? It is close to `e' on occur, and it seems that it is not used in any of dired/occur/wgrep yet. >> D. open-file-this-window >> Other candidates besides would be something like `M-' or 'M-o'? > > For a key to use for this-window you could look at `C-x C-b' (list-buffers) > that binds the key `f' to `Buffer-menu-this-window'. To assign `f' sounds very nice. Now proposed keys are summarized in Table 1. Table 1: A proposed mode, function, key-bind as-is, and key-bind plus to have consistency between dired-, occur-, and grep. |--------+----------------------------------------------+---------------+-----------| | mode | function | key-as-is | key-plus | |--------+----------------------------------------------+---------------+-----------| | ! | A. edit-buffer (enable/finish/abort) | | | |--------+----------------------------------------------+---------------+-----------| | wdired | (dired-toggle-read-only) | "C-x C-q" | "E" | | | (wdired-finish-edit) | "C-c C-c" | | | | (wdired-abort-changes) | "C-c C-k" | | | occur | (occur-edit-mode) | "e" | "E" | | | (occur-cease-edit) | "C-c C-c" | | | | ? | | "C-c C-k" | | wgrep | (wgrep-change-to-wgrep-mode) | "C-c C-p" | "E" | | | (wgrep-finish-edit) | "C-c C-c" | | | | (wgrep-abort-changes) | "C-c C-k" | | |--------+----------------------------------------------+---------------+-----------| | ! | B. open-file-other-window | | | |--------+----------------------------------------------+---------------+-----------| | dired | (dired-find-file-other-window) | "o" | | | occur | (occur-mode-goto-occurrence-other-window) | and "o" | | | grep | (compile-goto-error) | | "o" | |--------+----------------------------------------------+---------------+-----------| | ! | C. open-file-other-window-no-select | | | |--------+----------------------------------------------+---------------+-----------| | dired | (dired-display-file) | "C-o" | | | occur | (occur-mode-display-occurrence) | "C-o" | | | grep | (grep-mode-display-occurrence); *1 | | "C-o" | |--------+----------------------------------------------+---------------+-----------| | ! | D. open-file-this-window | | | |--------+----------------------------------------------+---------------+-----------| | dired | (dired-find-file) | and "f" | | | occur | (occur-mode-goto-occurrence-this-window); *2 | | "f" | | grep | (compile-goto-error-this-window); *3 | | "f" | |--------+----------------------------------------------+---------------+-----------| | ! | Z. summary of function-assign-to- | | | |--------+----------------------------------------------+---------------+-----------| | dired | (dired-find-file) | and "f" | | | occur | (occur-mode-goto-occurrence-other-window) | and "o" | | | grep | (compile-goto-error) | | "o" | |--------+----------------------------------------------+---------------+-----------| ; *1 (defun grep-mode-display-occurrence () (interactive) (let ((compilation-context-lines nil)) (setq compilation-current-error (point)) (next-error-no-select 0))) ; *2 (defun occur-mode-goto-occurrence-this-window () "Go to the occurrence the current line describes, in this window." (interactive) (let ((pos (occur-mode-find-occurrence))) ;; (switch-to-buffer-other-window (marker-buffer pos)) (switch-to-buffer (marker-buffer pos)) (goto-char pos) (run-hooks 'occur-mode-find-occurrence-hook))) ; *3 ; http://stackoverflow.com/questions/15814031 (defun compile-goto-error-this-window () (interactive) (let ((display-buffer-overriding-action '(display-buffer-same-window (inhibit-same-window . nil))) (compilation-context-lines nil)) (setq compilation-current-error (point)) (compile-goto-error)))