From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bradd Subject: Re: Old 'C-c tab' binding shadowed Date: Sat, 9 Sep 2017 13:02:31 -0400 Message-ID: References: <84lglqgvcv.fsf@tm6592> <84377yupkw.fsf@tm6592> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c130c3ecd00990558c4a878" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqj9Q-00057D-VA for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 13:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqj9P-0007I1-Np for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 13:02:37 -0400 Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]:36191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqj9P-0007HM-Fg for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 13:02:35 -0400 Received: by mail-pf0-x235.google.com with SMTP id e199so8586288pfh.3 for ; Sat, 09 Sep 2017 10:02:33 -0700 (PDT) In-Reply-To: <84377yupkw.fsf@tm6592> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Marco Wahl Cc: emacs-orgmode@gnu.org, Kaushal Modi --94eb2c130c3ecd00990558c4a878 Content-Type: text/plain; charset="UTF-8" I also use this keybinding for opening subtrees to certain depths. My reasoning is identical to Marco's, it provides a great overview with very little noise. Would be nice to have these actions context dependent in org so we get the best of both worlds. Failing that, Kaushal's setup looks like a good solution. Cheers, Adrian On 7 September 2017 at 18:11, Marco Wahl wrote: > >> I think the bindings could coexist peacefully since > >> > > `org-table-toggle-column-width' makes sense only for the cursor located > >> in a table and `outline-show-children' makes most sense (AFAICS) when > >> called on a headline. > >> > >> Does this sound reasonable? > >> > >> Does anyone see clearly how to implement this? (I don't.) > >> > > > > I always wondered the same about other org-table-* bindings in org.el. > > > > This works: > > > > diff --git a/lisp/org.el b/lisp/org.el > > index a03d8c5a429..cba9b20482f 100644 > > --- a/lisp/org.el > > +++ b/lisp/org.el > > @@ -19632,7 +19632,12 @@ COMMANDS is a list of alternating OLDDEF NEWDEF > > command names." > > (org-defkey org-mode-map "\C-j" 'org-return-indent) > > (org-defkey org-mode-map "\C-c?" 'org-table-field-info) > > (org-defkey org-mode-map "\C-c " 'org-table-blank-field) > > -(org-defkey org-mode-map (kbd "C-c TAB") #'org-table-toggle-column- > width) > > +(org-defkey org-mode-map (kbd "C-c TAB") > > + '(menu-item "toggle-column-width-when-in-table" nil > > + :filter (lambda (&optional _) > > + (if (org-at-table-p) > > + #'org-table-toggle-column-width > > + #'outline-show-children)))) > > (org-defkey org-mode-map "\C-c+" 'org-table-sum) > > (org-defkey org-mode-map "\C-c=" 'org-table-eval-formula) > > (org-defkey org-mode-map "\C-c'" 'org-edit-special) > > > > I actually do this for org-table-* bindings in my config: > > > > ;; Bind the "org-table-*" command ONLY when the point is in an Org > > table. > > ;; http://emacs.stackexchange.com/a/22457/115 > > (bind-keys > > :map org-mode-map > > :filter (org-at-table-p) > > ("C-c ?" . org-table-field-info) > > ("C-c SPC" . org-table-blank-field) > > ("C-c +" . org-table-sum) > > ("C-c =" . org-table-eval-formula) > > ("C-c `" . org-table-edit-field) > > ("C-#" . org-table-rotate-recalc-marks) > > ("C-c }" . org-table-toggle-coordinate-overlays) > > ("C-c {" . org-table-toggle-formula-debugger)) > > > > Inspiration: > > http://endlessparentheses.com/define-context-aware-keys-in-emacs.html > > Thanks! > > Good to know a path to a personal configuration for the case no one else > is interested in the old C-c TAB behavior. > > > Ciao, > Marco > > > --94eb2c130c3ecd00990558c4a878 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I a= lso use this keybinding for opening subtrees to certain depths. My reasonin= g is identical to Marco's, it provides a great overview with very littl= e noise.

Would be nice to= have these actions context dependent in org so we get the best of both wor= lds. Failing that, Kaushal's setup looks like a good solution.

Cheers,

Adrian

<= div class=3D"gmail_quote">On 7 September 2017 at 18:11, Marco Wahl <= marcowahlsoft@gmail.com> wrote:
>> I think the bindings = could coexist peacefully since
>>
> `org-table-toggle-column-width' makes sense only for the curs= or located
>> in a table and `outline-show-children' makes most sense (AFAIC= S) when
>> called on a headline.
>>
>> Does this sound reasonable?
>>
>> Does anyone see clearly how to implement this?=C2=A0 (I don't.= )
>>
>
> I=C2=A0 always wondered the same about other org-table-* bindings in o= rg.el.
>
> This works:
>
> diff --git a/lisp/org.el b/lisp/org.el
> index a03d8c5a429..cba9b20482f 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -19632,7 +19632,12 @@ COMMANDS is a list of alternating OLDDEF NEWD= EF
> command names."
>=C2=A0 (org-defkey org-mode-map "\C-j"=C2=A0 =C2=A0 =C2=A0= 9;org-return-indent)
>=C2=A0 (org-defkey org-mode-map "\C-c?"=C2=A0 =C2=A0 'org= -table-field-info)
>=C2=A0 (org-defkey org-mode-map "\C-c "=C2=A0 =C2=A0 'org= -table-blank-field)
> -(org-defkey org-mode-map (kbd "C-c TAB") #'org-table-to= ggle-column-width)
> +(org-defkey org-mode-map (kbd "C-c TAB")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '(menu-item "toggl= e-column-width-when-in-table" nil
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 :filter (lambda (&optional _)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (org-at-table-p)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #'org-t= able-toggle-column-width
> +=C2=A0 =C2=A0 #'outline-show-children))))
>=C2=A0 (org-defkey org-mode-map "\C-c+"=C2=A0 =C2=A0 'org= -table-sum)
>=C2=A0 (org-defkey org-mode-map "\C-c=3D"=C2=A0 =C2=A0 'o= rg-table-eval-formula)
>=C2=A0 (org-defkey org-mode-map "\C-c'"=C2=A0 =C2=A0 '= ;org-edit-special)
>
> I actually do this for org-table-* bindings in my config:
>
>=C2=A0 =C2=A0 =C2=A0;; Bind the "org-table-*" command ONLY wh= en the point is in an Org
> table.
>=C2=A0 =C2=A0 =C2=A0;; http://emacs.stackexchange.com/a/22457/115
>=C2=A0 =C2=A0 =C2=A0(bind-keys
>=C2=A0 =C2=A0 =C2=A0 :map org-mode-map
>=C2=A0 =C2=A0 =C2=A0 :filter (org-at-table-p)
>=C2=A0 =C2=A0 =C2=A0 ("C-c ?" . org-table-field-info)
>=C2=A0 =C2=A0 =C2=A0 ("C-c SPC" . org-table-blank-field)
>=C2=A0 =C2=A0 =C2=A0 ("C-c +" . org-table-sum)
>=C2=A0 =C2=A0 =C2=A0 ("C-c =3D" . org-table-eval-formula)
>=C2=A0 =C2=A0 =C2=A0 ("C-c `" . org-table-edit-field)
>=C2=A0 =C2=A0 =C2=A0 ("C-#" . org-table-rotate-recalc-marks)<= br> >=C2=A0 =C2=A0 =C2=A0 ("C-c }" . org-table-toggle-coordinate-<= wbr>overlays)
>=C2=A0 =C2=A0 =C2=A0 ("C-c {" . org-table-toggle-formula-debugger))
>
> Inspiration:
> http://endlessparentheses.= com/define-context-aware-keys-in-emacs.html

Thanks!

Good to know a path to a personal configuration for the case no one else is interested in the old C-c TAB behavior.


Ciao,
=C2=A0 =C2=A0 =C2=A0Marco



--94eb2c130c3ecd00990558c4a878--