* [PATCH 0/3] No sub/superscript in property keys and two small fixes.
@ 2010-06-10 14:54 Mikael Fornius
2010-06-10 14:54 ` [PATCH 1/3] Removed unused test function Mikael Fornius
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Mikael Fornius @ 2010-06-10 14:54 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Mikael Fornius
Org-entities is great, thanks!
I suggest not to fontify property keywords.
I found an easy way to prevent org-mode to fontify sub/superscripts in
property keys by skipping text with font eq org-special-keyword.
What triggered me was the key :LAST_REPEAT: in org-habit who looked
silly.
I also stumbled upon an unused, unprefixed function named test which I
removed. Earlier I used let instead of save-match-data in my patch to
org-at-property-p which I also changed.
Feel free to apply these patches to org-mode if you like them.
Changes applies to
Org-mode version 6.36trans (release_6.36.253.g1546e.dirty)
Mikael Fornius (3):
Removed unused test function.
Use save-match-data macro instead of let.
Do not fontify subscripts of property keys.
lisp/org.el | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] Removed unused test function.
2010-06-10 14:54 [PATCH 0/3] No sub/superscript in property keys and two small fixes Mikael Fornius
@ 2010-06-10 14:54 ` Mikael Fornius
2010-06-10 14:54 ` [PATCH 2/3] Use save-match-data macro instead of let Mikael Fornius
2010-06-10 14:54 ` [PATCH 3/3] Do not fontify subscripts of property keys Mikael Fornius
2 siblings, 0 replies; 4+ messages in thread
From: Mikael Fornius @ 2010-06-10 14:54 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Mikael Fornius
* org.el (test): Removed unused test function.
---
lisp/org.el | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 5cbd10a..2a2cef9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15571,10 +15571,6 @@ looks only before point, not after."
(org-in-regexp
"\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*")))
-(defun test ()
- (interactive)
- (message "%s" (org-inside-latex-macro-p)))
-
(defun org-try-cdlatex-tab ()
"Check if it makes sense to execute `cdlatex-tab', and do it if yes.
It makes sense to do so if `org-cdlatex-mode' is active and if the cursor is
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] Use save-match-data macro instead of let.
2010-06-10 14:54 [PATCH 0/3] No sub/superscript in property keys and two small fixes Mikael Fornius
2010-06-10 14:54 ` [PATCH 1/3] Removed unused test function Mikael Fornius
@ 2010-06-10 14:54 ` Mikael Fornius
2010-06-10 14:54 ` [PATCH 3/3] Do not fontify subscripts of property keys Mikael Fornius
2 siblings, 0 replies; 4+ messages in thread
From: Mikael Fornius @ 2010-06-10 14:54 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Mikael Fornius
* org.el (org-at-property-p): Use save-match-data macro instead of let.
---
lisp/org.el | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 2a2cef9..7715ad7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13198,12 +13198,11 @@ allowed value."
(save-excursion
(beginning-of-line 1)
(when (looking-at (org-re "^[ \t]*\\(:\\([[:alpha:]][[:alnum:]_-]*\\):\\)[ \t]*\\(.*\\)"))
- (let ((match (match-data)) ;; Keep match-data for use by calling
- (p (point)) ;; procedures.
- (range (unless (org-before-first-heading-p)
- (org-get-property-block))))
- (prog1 (and range (<= (car range) p) (< p (cdr range)))
- (set-match-data match))))))
+ (save-match-data ;; Used by calling procedures
+ (let ((p (point))
+ (range (unless (org-before-first-heading-p)
+ (org-get-property-block))))
+ (and range (<= (car range) p) (< p (cdr range))))))))
(defun org-get-property-block (&optional beg end force)
"Return the (beg . end) range of the body of the property drawer.
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] Do not fontify subscripts of property keys.
2010-06-10 14:54 [PATCH 0/3] No sub/superscript in property keys and two small fixes Mikael Fornius
2010-06-10 14:54 ` [PATCH 1/3] Removed unused test function Mikael Fornius
2010-06-10 14:54 ` [PATCH 2/3] Use save-match-data macro instead of let Mikael Fornius
@ 2010-06-10 14:54 ` Mikael Fornius
2 siblings, 0 replies; 4+ messages in thread
From: Mikael Fornius @ 2010-06-10 14:54 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Mikael Fornius
* org.el (org-raise-scripts): Do not fontify sub/superscripts of text
with face `org-special-keyword'. Makes property keys as :LAST_REPEAT:
display correctly.
---
lisp/org.el | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 7715ad7..9c7a427 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5515,14 +5515,16 @@ and subscriipts."
org-match-substring-regexp
org-match-substring-with-braces-regexp)
limit t)
- (let* ((pos (point)) table-p comment-p emph-p link-p)
- (setq emph-p (get-text-property (match-beginning 3) 'org-emphasis))
- (setq link-p (get-text-property (match-beginning 3) 'mouse-face))
+ (let* ((pos (point)) table-p comment-p
+ (mpos (match-beginning 3))
+ (emph-p (get-text-property mpos 'org-emphasis))
+ (link-p (get-text-property mpos 'mouse-face))
+ (keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
(goto-char (point-at-bol))
(setq table-p (org-looking-at-p org-table-dataline-regexp)
comment-p (org-looking-at-p "[ \t]*#"))
(goto-char pos)
- (if (or comment-p emph-p link-p)
+ (if (or comment-p emph-p link-p keyw-p)
t
(put-text-property (match-beginning 3) (match-end 0)
'display
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-10 14:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-10 14:54 [PATCH 0/3] No sub/superscript in property keys and two small fixes Mikael Fornius
2010-06-10 14:54 ` [PATCH 1/3] Removed unused test function Mikael Fornius
2010-06-10 14:54 ` [PATCH 2/3] Use save-match-data macro instead of let Mikael Fornius
2010-06-10 14:54 ` [PATCH 3/3] Do not fontify subscripts of property keys Mikael Fornius
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).