From: Greg Minshall <minshall@acm.org>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: non-space, paste, (???) character for inline results
Date: Wed, 31 Jan 2018 23:11:37 +0530 [thread overview]
Message-ID: <4143.1517420497@minshall-apollo.minshall.org> (raw)
In-Reply-To: Your message of "Wed\, 31 Jan 2018 17\:19\:18 +0100." <87a7wuypa1.fsf@nicolasgoaziou.fr>
[-- Attachment #1: Type: text/plain, Size: 556 bytes --]
Nico,
> I meant zero-width space, not non-breaking space. Note that it can be
> used in other places to escape special characters, e.g., verbatim
> markup.
ah. how does one enter a zero-width space in emacs/org-mode? also, i'm
curious about how it looks on the screen. (for me, i'd want it to look,
on the screen, *very* obvious that *something* is there.)
i also apologize that the patch i sent before is incomplete -- i forgot
to modify a bit of "src_" processing; a new attempt is below. (not sure
if that format is suitable.)
cheers, Greg
----
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-use-as-a-paste-character-for-call_-and-src_-2.patch --]
[-- Type: text/x-diff, Size: 2585 bytes --]
From e0337aabb13fabcefbb0a9fd65e8d4c9bcd412ee Mon Sep 17 00:00:00 2001
From: Greg Minshall <minshall@acm.org>
Date: Wed, 31 Jan 2018 20:38:35 +0530
Subject: [PATCH 1/2] use '#' as a "paste" character (for call_ and src_)
---
lisp/org-element.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 5af2d6e..5fc3b2d 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -162,7 +162,7 @@ specially in `org-element--object-lex'.")
"\\\\\\(?:[a-zA-Z[(]\\|\\\\[ \t]*$\\|_ +\\)"
;; Objects starting with raw text: inline Babel
;; source block, inline Babel call.
- "\\(?:call\\|src\\)_"))
+ "#?\\(?:call\\|src\\)_"))
"\\|")))
(org-element--set-regexps)
@@ -2878,7 +2878,7 @@ Assume point is at the beginning of the babel call."
(save-excursion
(catch :no-object
(when (let ((case-fold-search nil))
- (looking-at "call_\\([^ \t\n[(]+\\)[([]"))
+ (looking-at "#?\\<call_\\([^ \t\n[(]+\\)[([]"))
(goto-char (match-end 1))
(let* ((begin (match-beginning 0))
(call (match-string-no-properties 1))
@@ -4383,10 +4383,12 @@ to an appropriate container (e.g., a paragraph)."
(let ((result (match-string 0)))
(setq found
(cond
- ((string-prefix-p "call_" result t)
+ ((or (string-prefix-p "call_" result t)
+ (string-prefix-p "#call_" result t))
(and (memq 'inline-babel-call restriction)
(org-element-inline-babel-call-parser)))
- ((string-prefix-p "src_" result t)
+ ((or (string-prefix-p "src_" result t)
+ (string-prefix-p "#src_" result t))
(and (memq 'inline-src-block restriction)
(org-element-inline-src-block-parser)))
(t
--
2.7.4
From b032d0860431ff29e7136145605d4f3d981d5301 Mon Sep 17 00:00:00 2001
From: Greg Minshall <minshall@acm.org>
Date: Wed, 31 Jan 2018 22:53:06 +0530
Subject: [PATCH 2/2] oops, forgot (looking-at .*src_...)
---
lisp/org-element.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 5fc3b2d..7f70f4a 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2932,7 +2932,7 @@ Assume point is at the beginning of the inline src block."
(save-excursion
(catch :no-object
(when (let ((case-fold-search nil))
- (looking-at "src_\\([^ \t\n[{]+\\)[{[]"))
+ (looking-at "#?\\<src_\\([^ \t\n[{]+\\)[{[]"))
(goto-char (match-end 1))
(let ((begin (match-beginning 0))
(language (match-string-no-properties 1))
--
2.7.4
next prev parent reply other threads:[~2018-01-31 17:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 8:29 non-space, paste, (???) character for inline results Greg Minshall
2018-01-30 9:15 ` Nicolas Goaziou
2018-01-30 13:06 ` Greg Minshall
2018-01-30 20:55 ` Nicolas Goaziou
2018-01-31 1:19 ` Greg Minshall
2018-01-31 11:13 ` Nicolas Goaziou
2018-01-31 15:12 ` Greg Minshall
2018-01-31 16:19 ` Nicolas Goaziou
2018-01-31 17:41 ` Greg Minshall [this message]
2018-01-31 17:52 ` Kaushal Modi
2018-01-31 17:54 ` Kaushal Modi
2018-01-31 18:09 ` Nicolas Goaziou
2018-02-01 6:23 ` Greg Minshall
2018-02-03 14:01 ` Nicolas Goaziou
2018-02-03 14:27 ` Greg Minshall
2018-02-03 14:31 ` Nicolas Goaziou
2018-02-03 14:41 ` Greg Minshall
2018-02-03 23:33 ` Nicolas Goaziou
2018-02-05 23:15 ` Greg Minshall
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=4143.1517420497@minshall-apollo.minshall.org \
--to=minshall@acm.org \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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).