emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [RFC] Creole-style / Support for **emphasis**__within__**a word**
Date: Tue, 04 Mar 2014 18:30:10 +0530	[thread overview]
Message-ID: <87ioruktk5.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]


Nicolas

(Re-sent with the diff file)

[RFC] Creole-style / Support for **emphasis**__within__**a word**

The attached files should speak for themselves.  Such an arrangement

a) Does not change the status quo AT ALL.
b) Provide more rope.

The patch is in the spirit of "show and tell".

That said, if I were to say "Let's formalize this arrangement" what will
you say?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emphasis.org --]
[-- Type: text/x-org, Size: 659 bytes --]

#+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline
#+OPTIONS: author:nil c:nil creator:comment d:(not "LOGBOOK") date:nil
#+OPTIONS: e:t email:nil f:t inline:t num:nil p:nil pri:nil prop:nil
#+OPTIONS: stat:t tags:t tasks:t tex:t timestamp:t toc:nil todo:t |:t
#+TITLE: a
#+DATE: <2014-03-04 Tue>
#+AUTHOR: Jambunathan K
#+EMAIL: kjambunathan@debian-6.05
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE: en
#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport
#+CREATOR: Emacs 24.3.50.33 (Org mode 8.2.5h)

Support for **emphasis**__within__**a word**. ==A proposal==.

* Headline 1

**bold**and**bold**//italic// __underline__==and==++strike-through++ plain text

[-- Attachment #3: emphasis.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 10286 bytes --]

[-- Attachment #4: .emacs.minimal.el --]
[-- Type: application/emacs-lisp, Size: 1097 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: org-emphasis.diff --]
[-- Type: text/x-diff, Size: 2676 bytes --]

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 0faf1fd..131b442 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2612,6 +2612,11 @@ Assume point is at the first star marker."
 CONTENTS is the contents of the object."
   (format "*%s*" contents))
 
+(defvar org-element--marker->type 
+  (loop for markers in  (mapcar 'car org-emphasis-alist)
+	for element-type in '(bold italic underline verbatim code strike-through)
+	collect (cons markers element-type)))
+
 (defun org-element-text-markup-successor ()
   "Search for the next text-markup object.
 
@@ -2622,15 +2627,10 @@ and CDR is beginning position."
     (unless (bolp) (backward-char))
     (when (re-search-forward org-emph-re nil t)
       (let ((marker (match-string 3)))
-	(cons (cond
-	       ((equal marker "*") 'bold)
-	       ((equal marker "/") 'italic)
-	       ((equal marker "_") 'underline)
-	       ((equal marker "+") 'strike-through)
-	       ((equal marker "~") 'code)
-	       ((equal marker "=") 'verbatim)
-	       (t (error "Unknown marker at %d" (match-beginning 3))))
-	      (match-beginning 2))))))
+	(cons
+	 (or (assoc-default marker org-element--marker->type)
+	     (error "Unknown marker at %d" (match-beginning 3)))
+	 (match-beginning 2))))))
 
 
 ;;;; Code
diff --git a/lisp/org.el b/lisp/org.el
index f2bb99f..24f07f9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4191,10 +4191,14 @@ After a match, the match groups contain these elements:
 	   (body (nth 3 e))
 	   (nl (nth 4 e))
 	   (body1 (concat body "*?"))
-	   (markers (mapconcat 'car org-emphasis-alist ""))
+	   (markers (mapconcat (lambda (em)
+				 (regexp-quote (car em))
+				 )
+			       org-emphasis-alist "\\|"))
 	   (vmarkers (mapconcat
-		      (lambda (x) (if (eq (nth 2 x) 'verbatim) (car x) ""))
-		      org-emphasis-alist "")))
+		      (lambda (x)
+			(regexp-quote (if (eq (nth 2 x) 'verbatim) (car x) "")))
+		      org-emphasis-alist "\\|")))
       ;; make sure special characters appear at the right position in the class
       (if (string-match "\\^" markers)
 	  (setq markers (concat (replace-match "" t t markers) "^")))
@@ -4211,7 +4215,7 @@ After a match, the match groups contain these elements:
       (setq org-emph-re
 	    (concat "\\([" pre "]\\|^\\)"
 		    "\\("
-		    "\\([" markers "]\\)"
+		    "\\(" markers "\\)"
 		    "\\("
 		    "[^" border "]\\|"
 		    "[^" border "]"
@@ -4223,7 +4227,7 @@ After a match, the match groups contain these elements:
       (setq org-verbatim-re
 	    (concat "\\([" pre "]\\|^\\)"
 		    "\\("
-		    "\\([" vmarkers "]\\)"
+		    "\\(" vmarkers "\\)"
 		    "\\("
 		    "[^" border "]\\|"
 		    "[^" border "]"

             reply	other threads:[~2014-03-04 13:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 13:00 Jambunathan K [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-04 13:11 [RFC] Creole-style / Support for **emphasis**__within__**a word** Jambunathan K
2014-03-04 14:55 ` Jambunathan K
2014-03-22 14:05 ` Nicolas Goaziou
2014-03-22 14:21   ` Bastien
2014-03-22 14:54     ` Andreas Leha
2014-03-22 15:22       ` Bastien
2014-03-22 15:30     ` Nicolas Goaziou
2014-03-22 15:37       ` Bastien
2014-03-23  0:53         ` Samuel Wales
2014-03-23  0:06       ` Marcin Borkowski
2014-03-23 11:32         ` Suvayu Ali
2014-03-23 11:39           ` Marcin Borkowski
2014-03-23  2:59   ` Jambunathan K
2022-01-24 10:50     ` [O] " Vincent Belaïche
2022-01-24 11:54       ` Nicolas Goaziou
2022-01-24 12:09       ` [O] " Juan Manuel Macías
2022-01-24 12:32         ` Vincent Belaïche
2022-01-25 10:55           ` Nicolas Goaziou
2022-01-25 17:18             ` Vincent Belaïche
2022-01-25 17:30               ` Juan Manuel Macías
2022-01-25 18:45                 ` Vincent Belaïche
2022-01-25 17:52               ` Nicolas Goaziou
2022-01-25 18:20               ` Vincent Belaïche
2022-01-25 16:27           ` Max Nikulin
2014-03-04 12:56 Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ioruktk5.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).