From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: including emphasis characters as word characters? Date: Thu, 22 Nov 2012 10:10:11 +0800 Message-ID: <87624ypev0.fsf@ericabrahamsen.net> References: <874nkjcz2d.fsf@ericabrahamsen.net> <20121121134622.GB31515@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbMBb-0002a1-US for emacs-orgmode@gnu.org; Wed, 21 Nov 2012 21:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbMBa-0005yI-T4 for emacs-orgmode@gnu.org; Wed, 21 Nov 2012 21:06:39 -0500 Received: from plane.gmane.org ([80.91.229.3]:57477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbMBa-0005y9-MP for emacs-orgmode@gnu.org; Wed, 21 Nov 2012 21:06:38 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TbMBg-0008RP-SG for emacs-orgmode@gnu.org; Thu, 22 Nov 2012 03:06:44 +0100 Received: from 114.250.108.240 ([114.250.108.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Nov 2012 03:06:44 +0100 Received: from eric by 114.250.108.240 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Nov 2012 03:06:44 +0100 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: emacs-orgmode@gnu.org Suvayu Ali writes: > On Wed, Nov 21, 2012 at 01:19:54PM +0800, Eric Abrahamsen wrote: >> Would it make sense to add the markup characters (ie, the car of every >> item in `org-emphasis-alist') to the list of word characters, so that as >> we're moving/deleting/transposing by word in org, the markup characters >> are included? I mean with a sentence like: >> >> #+BEGIN_SRC org >> I read a book called /Fortress Besieged/ and it was awful. >> #+END_SRC >> >> If point is at end of the sentence, I'd like to be able to hit "M-6 M-b" >> and have point end up just before the first slash, then hit "M-2 M-d" and >> kill both words plus second slash. >> >> Would this be a bad idea for some reason? >> > > IMO unless it can be done conditionally, as in it is not part of a word > when not used as markup, it will be very bad. What about legitimate > uses like: > > I am feeling blue / green. > > or, > > Addition is denoted by the + sign. Interesting! In these cases, actually, I like having the slash and plus be a one-character "word", I find editing the sentence much more intuitive. But I did notice that now, `transpose-words' can produce some ugly results. Before, with point between the two words: /Fortress Beseiged/ --> /Beseiged Fortress/ Now: /Beseiged Fortress/ --> Fortress/ /Beseiged Not so good. Perhaps what I actually want is to give these markup characters "parenthesis"-type syntax. I'll give that a shot. Editing preferences are subjective, but I'm also worried this will play havoc with export/tables/table formulas/source blocks. I'll just run it for a while and see what breaks. Thanks for the input. Eric FYI, here's what I'm using, in a hook: --8<---------------cut here---------------start------------->8--- (defun my-emph-to-word () (when (eq major-mode 'org-mode) (mapc (lambda (x) (modify-syntax-entry (string-to-char (car x)) "w")) org-emphasis-alist))) --8<---------------cut here---------------end--------------->8---