emacs autopair, paren, method comparison



hi Uday Reddy,

On Jan 16, 2:57 pm, Uday Reddy 〔usr.vm.ro...@gmail.com〕 wrote:
│ On 1/6/2012 4:31 PM, Xah Lee wrote:

│ │ i'd recommend not to use any minor mode for this. Here's my solution:

│ │ 〈Emacs: Insert Brackets by Pair〉
│ │http://xahlee.org/emacs/emacs_insert_brackets_by_pair.html

│ Xah Lee, here are 3 use cases for you:

│ 1. To type (x), you want to type exactly that: an `(' an `x' and a `)'.
│   Got it?

huh? I just type 【Menu+d x】. 2 keys (one combo plus a single key). and the keys are Thumb and home row on left hand.

As opposed to 【Shift+9 x Shift+0】, which is 3 keys (2 combos and a single key) that involves lots pinky.

(i actually use Dvorak layout, so the 【Menu+d x】 is actually 【Menu+e q】. But i'll stick to qwerty notation in this message for easy understanding for the masses)

│ 2. If you change your mind after typing `(', when the buffer has (), you
│ want to hit DEL or BSP, and both the parens should disappear.

No. I use ErgoEmacs keybinding. So, after i typed 【Menu+d】 to have inserted () , and if i decided i don't want it, either i undo 【Alt+z】, or hold Alt and press “df” (that is: 【Alt+d Alt+f】), which delets backward and forward. This is better than moving your hand to far upper right to press Backspace then Delete key.

│ 3. If you have xyz in your text, and you want to put it in brackets, you
│ want to select it and hit either
│    - `(' to produce (xyz) and move to the beginning of (xyz), or
│    - `)' to produce (xyz) and move to the closing of (xyz).

not quite sure i understand what you mean here.

if i have “xyz” in my text, and i want to make it “(xyz)”, i press 【Alt+e】 once to to delete the “xyz”, then 【Menu+d】 to insert the paren, then F3 or 【Alt+v】 to paste the “xyz” back.

│ Once you have "solutions" for these 3 use cases, we will be happy to
│ give you more.

so now you see my power?

my method doesn't require esoteric learning. It is standard across all OS and apps. While, yours, i suppose the emacs way, requires much more learning and being less efficient, to boot.

please let me know if there's any part that's not clear, or needs to be challenged.

PS if you don't know already, my first 6 years of using emacs (1998-2005) is in text terminal EXCLUSIVELY (repeate: text terminal EXCLUSIVELY, as i despise unix fucking X11, and semi-refused to install X11 when collegue asked as a sys admin on Solaris boxes), and using emacs default keybinding EXCLUSIVELY. I've documented my experience here a few times as well as a essay on my emacs tutorial site. Please Let me know if you require a link.


No comments:

Post a Comment