From mboxrd@z Thu Jan 1 00:00:00 1970 From: Calvin Young Subject: Re: Emulating list functionality from traditional GUI editors Date: Thu, 11 Dec 2014 10:19:23 -0800 Message-ID: References: <878uieqeej.fsf@yale.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113fd6460905ee0509f4d2f4 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz8L7-0004OU-10 for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 13:19:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz8L3-0003lz-1Z for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 13:19:48 -0500 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]:61567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz8L2-0003lo-Iz for emacs-orgmode@gnu.org; Thu, 11 Dec 2014 13:19:44 -0500 Received: by mail-ie0-f173.google.com with SMTP id y20so5357855ier.32 for ; Thu, 11 Dec 2014 10:19:44 -0800 (PST) In-Reply-To: <878uieqeej.fsf@yale.edu> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Jorge A. Alfaro-Murillo" Cc: emacs-orgmode@gnu.org --001a113fd6460905ee0509f4d2f4 Content-Type: text/plain; charset=ISO-8859-1 Jorge, thanks for the quick response! > * If the cursor is at the end of a list item, then "Return" should >> insert a new list item (i.e., automatically perform org-meta-return) >> > > M- does this. You do not want to do that because you when > you want to finish the list finishes it. > I don't think I explained myself clearly the first time around. The behavior I'm hoping to achieve (i.e., the default bulletting behavior in Google Docs, OSX Notes, etc.) is as follows: ;; Starting with this setup: - one - two + a[CURSOR_HERE] ;; Hitting should produce: - one - two + a + [CURSOR_HERE] ;; Hitting again would then produce: - one - two + a - [CURSOR_HERE] ;; And hitting one last time would produce: - one - two + a [CURSOR_HERE] I know we can already achieve this with some combination of M-, , and M-S-, but this behavior has 2 distinct advantages: 1. The user only needs to remember one key to cycle between all of these actions, rather than 3 key combinations. 2. This behavior is more consistent with the bulleting behavior in other editors, which could make it feel more intuitive for new org-mode users. > * If the cursor is at the beginning of an empty list item, then >> "Return" should outdent the list item (or remove it if it's already at >> the outer-most indentation level) >> > > I am not sure that I understand this but I assume that you would obtain > the same with . It goes back and forth between levels of list so if > you have > > - one > - two > + a > + CURSOR_HERE > > and you hit then it changes to > - one > - two > + a > + CURSOR_HERE > > and then two times (or S- from the beginning) changes it to > > - one > - two > + a > - CURSOR_HERE > Yes, but for the reasons mentioned above, it'd be nice if we could use the to outdent a new list entry as well. > * If the cursor is at the beginning of an empty list item, then >> "Backspace" should delete the list item and move my cursor to the end of >> the previous list item >> > > I guess you could remap to a function that checks if you are > at the beginning of the list and when that is true it does what you want, > otherwise it just calls `delete-backward-char'. But generally I would do > C-a C-k , just two more keystrokes. > Makes sense. This is an easy function to write -- just wanted to make sure there wasn't something that already does this out-of-the-box. > * It'd be nice of these rules could be applied to checkboxes as well >> > > M-S- inserts a check box. In general, I *believe* a lot of folks use lists and checkboxs in similar ways. I certainly do, and I frequently accidentally hit M- while editing a checkbox when I really intend to insert a new checkbox entry. As a result, it seems desirable to create an interface that treats them more similarly (e.g., using a single keypress to auto-insert a new entry). If this doesn't exist yet, I'd be happy to roll it myself. But it'd be nice to avoid re-inventing the wheel here if possible :) --001a113fd6460905ee0509f4d2f4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Jorge, thanks for the quick response!
 
* If the cursor is at the end of a list item, then "Return" shoul= d   insert a new list item (i.e., automatically perform  &nb= sp;org-meta-return)

M-<enter> does this. You do not want <enter> to do that because= you when you want to finish the list <enter> finishes it.

I don't think I explained myself clearly the = first time around. The behavior I'm hoping to achieve (i.e., the defaul= t bulletting behavior in Google Docs, OSX Notes, etc.) is as follows:
=

;; Starting with this setup:

- one<= br>
- two
 + a[CURSOR_HERE]

;; Hitting <enter> should produce:

- one
- two + a
 + [CURSOR_HERE]

;; = Hitting <enter> again would then produce:

- one
- two
 + a
- [CURSOR_HERE]

;; And hitting <enter> one last time would produce:

- one
- two
 + a

[CURS= OR_HERE]

I know we can already achieve= this with some combination of M-<enter>, <enter>, and M-S-<= enter>, but this behavior has 2 distinct advantages:

1. The user only needs to remember one key to cycle between all of th= ese actions, rather than 3 key combinations.
2. This behavior is = more consistent with the bulleting behavior in other editors, which could m= ake it feel more intuitive for new org-mode users.
 
* If the cursor is at the beginning of an empty list item, then   = ;"Return" should outdent the list item (or remove it if it's&= nbsp;  already at the outer-most indentation level)

I am not sure that I understand this but I assume that you would obtain the= same with <tab>. It goes back and forth between levels of list so if= you have

- one
- two
 + a
 + CURSOR_HERE

and you hit <tab> then it changes to
- one
- two
 + a
   + CURSOR_HERE

and then two times <tab> (or S-<tab> from the beginning) change= s it to

- one
- two
 + a
- CURSOR_HERE

Yes, but for the reasons = mentioned above, it'd be nice if we could use the <enter> to outd= ent a new list entry as well.
 
* If the cursor is at the beginning of an empty list item, then   = ;"Backspace" should delete the list item and move my cursor to&nb= sp;  the end of the previous list item

I guess you could remap <backspace> to a function that checks if you = are at the beginning of the list and when that is true it does what you wan= t, otherwise it just calls `delete-backward-char'. But generally I woul= d do C-a C-k <backspace>, just two more keystrokes.
<= div>
Makes sense. This is an easy function to write — j= ust wanted to make sure there wasn't something that already does this o= ut-of-the-box.
 
* It'd be nice of these rules could be applied to checkboxes as well

M-S-<enter> inserts a check box.

In g= eneral, I *believe* a lot of folks use lists and checkboxs in similar ways.= I certainly do, and I frequently accidentally hit M-<enter> while ed= iting a checkbox when I really intend to insert a new checkbox entry. As a = result, it seems desirable to create an interface that treats them more sim= ilarly (e.g., using a single <enter> keypress to auto-insert a new en= try).

If this doesn't exist yet, I'd be ha= ppy to roll it myself. But it'd be nice to avoid re-inventing the wheel= here if possible :)
--001a113fd6460905ee0509f4d2f4--