From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Bochannek Subject: Re: Remember templates and time stamp rounding. Date: Fri, 17 Mar 2006 10:40:42 -0800 Message-ID: References: <7cf02f796be26d1c55a294fb6626051f@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FKJsV-0003Nc-FE for emacs-orgmode@gnu.org; Fri, 17 Mar 2006 13:40:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FKJsT-0003NE-Pm for emacs-orgmode@gnu.org; Fri, 17 Mar 2006 13:40:47 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FKJsT-0003NB-Jq for emacs-orgmode@gnu.org; Fri, 17 Mar 2006 13:40:45 -0500 Received: from [207.17.137.64] (helo=colo-dns-ext2.juniper.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1FKJxP-0005FT-4l for emacs-orgmode@gnu.org; Fri, 17 Mar 2006 13:45:51 -0500 In-Reply-To: (Carsten Dominik's message of "Fri, 17 Mar 2006 10:57:08 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org Carsten Dominik writes: >> For the emphasis font-locks, these regexps work well for me: >> >> (if em '("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[: >> space:]]+\\)\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold)) >> (if em >> ("\\([[:punct:][:space:]]\\|^\\)\\(/\\([^/[:space:]]+\\)/\\)\\([[: >> space:][:punct:]]\\|$\\)" 0 'italic)) >> (if em >> ("\\([[:punct:][:space:]]\\|^\\)\\(_\\([^_[:space:]]+\\)_\\)\\([[: >> space:][:punct:]]\\|$\\)" 0 'underline)) > > Hi Alex, what is wrong with the expressions I have in org.el? The issue was that there would be no emphasis added when there was punctuation before or after it. Punctuation inside would also break it. Finally, I think the :space: character class is a bit more inclusive than what you used, but I don't recall for sure. Basically, the regexp above says: punctuation or white space or beginning of line followed by the emphasis character at least one non-emphasis or space character followed by the emphasis character punctuation or white space or end of line I seem to recall that I ran into an issue when I did something like: *foo-bar* and it wouldn't emphasize. By the way, I am also leaning towards allowing multiple tokens that are separated by one space since I sometimes would use it to emphasize commands like: *ls -l*. Maybe this would be better: '("\\([[:punct:][:space:]]\\|^\\)\\(\\*\\([^*[:space:]]+\\)\\( \\([^*[:space:]]+\\)\\)*\\*\\)\\([[:space:][:punct:]]\\|$\\)" 0 'bold) Alex.