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: Mon, 23 Dec 2013 20:34:59 +0900 (JST) Message-ID: <20131223.203459.187619082.tkk@misasa.okayama-u.ac.jp> References: <87sitl51un.fsf@mail.jurta.org> <20131222.204850.283027925.tkk@misasa.okayama-u.ac.jp> <87ppoo8srl.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 1387798574 16319 80.91.229.3 (23 Dec 2013 11:36:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Dec 2013 11:36:14 +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 Mon Dec 23 12:36:20 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 1Vv3o2-0001GI-5L for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Dec 2013 12:36:18 +0100 Original-Received: from localhost ([::1]:33059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv3o1-0004T1-RU for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Dec 2013 06:36:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv3ns-0004S9-Mu for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 06:36:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv3nm-0007LD-8V for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 06:36:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv3nm-0007L5-4e for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 06:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vv3nl-0003Ex-N3 for bug-gnu-emacs@gnu.org; Mon, 23 Dec 2013 06:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Dec 2013 11:36: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.138779851412368 (code B ref 16214); Mon, 23 Dec 2013 11:36:01 +0000 Original-Received: (at 16214) by debbugs.gnu.org; 23 Dec 2013 11:35:14 +0000 Original-Received: from localhost ([127.0.0.1]:35430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv3my-0003DN-HA for submit@debbugs.gnu.org; Mon, 23 Dec 2013 06:35:13 -0500 Original-Received: from msmail2.misasa.okayama-u.ac.jp ([150.46.245.7]:58435 helo=msmail.misasa.okayama-u.ac.jp) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv3mu-0003D6-C4 for 16214@debbugs.gnu.org; Mon, 23 Dec 2013 06:35:10 -0500 Original-Received: from localhost (p8181-ipbfp304tottori.tottori.ocn.ne.jp [114.155.19.181]) by msmail.misasa.okayama-u.ac.jp (Postfix) with ESMTP id 510B0AF8094; Mon, 23 Dec 2013 20:35:05 +0900 (JST) In-Reply-To: <87ppoo8srl.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:82431 Archived-At: Thank you for the response. > Inconsistency in opening in other window between Dired ("o") and > occur/grep () is a good inconsistency, because the primary > purpose of occur/grep is to open files in other window, so > more easy to type key is more suitable for occur/grep > to open a file in other window. I see. It sounds reasonable to be assigned to the primary purpose. Following is when I think that to assign to (open-file-this-window) is convenient. 1. On edition of in a single window, I feel like referring to sentences in a different file. 2. (grep) something, then *grep* pops up in (other-window). 3. I will find a line in file-b; move cursor to the line on *grep* 4. Hit then pops up on the first window 5. The buffer disappears then I lost. Now I know that I have to prepare the third window before hit ! 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. After exercises, one can lean to hit `o', which actually is more easy to type than . How do you think about with considering new users? Let me focus on dired/occur/grep with four functions (A-D) for now. Proposed keys are summarized in Table 1. A. edit-buffer B. open-file-other-window C. open-file-other-window-no-select D. open-file-this-window 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? B. open-file-other-window As you mentioned, add `o' to (compile-goto-error) will do it. C. open-file-other-window-no-select Same thing, add `C-o' to something like (compilation-display-error) will do it. D. open-file-this-window Other candidates besides would be something like `M-' or 'M-o'? Tak 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" | | | | (wdired-finish-edit) | "C-c C-c" | | | | (wdired-abort-changes) | "C-c C-k" | | | occur | (occur-edit-mode) | "e" | "C-x C-q" | | | (occur-cease-edit) | "C-c C-c" | | | | ? | | "C-c C-k" | | wgrep | (wgrep-change-to-wgrep-mode) | "C-c C-p" | "C-x C-q" | | | (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) | | ? | | occur | (occur-mode-goto-occurrence-this-window); *2 | | ? | | grep | (compile-goto-error-this-window); *3 | | ? | |--------+----------------------------------------------+---------------+-----------| | ! | Z. summary of function-assign-to- | | | |--------+----------------------------------------------+---------------+-----------| | dired | (dired-find-file) | | | | 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)))