aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/.emacs.d/lisp/my/my-libgen.el2
-rw-r--r--emacs/.emacs.d/lisp/my/wiki.el34
2 files changed, 17 insertions, 19 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-libgen.el b/emacs/.emacs.d/lisp/my/my-libgen.el
index 303c927..09a663a 100644
--- a/emacs/.emacs.d/lisp/my/my-libgen.el
+++ b/emacs/.emacs.d/lisp/my/my-libgen.el
@@ -145,7 +145,7 @@
(defvar my-libgen-download-dir "~/Downloads")
(defun my-libgen-download-action ()
(interactive)
- (let ((info (get-text-property (point) 'button-data)))
+ (let ((info (get-text-property (point) 'button-data)))
(my-wget-async
(car (link-gopher-get-all-links
(format "%s/main/%s" my-libgen-library-host
diff --git a/emacs/.emacs.d/lisp/my/wiki.el b/emacs/.emacs.d/lisp/my/wiki.el
index 468244c..4b8184d 100644
--- a/emacs/.emacs.d/lisp/my/wiki.el
+++ b/emacs/.emacs.d/lisp/my/wiki.el
@@ -48,9 +48,9 @@
(cons "^==.*==\\ *$" 'wiki-level-2)
(cons "^=.*=\\ *$" 'wiki-level-1)
(cons "^----+\\ *$" 'wiki-hr-face)
- (cons "'''''[^ \t\n].*[^ \t\n]'''''" 'wiki-bold-italic)
- (cons "'''[^ \t\n'].*[^ \t\n']'''" 'wiki-bold)
- (cons "''[^ \t\n'].*[^ \t\n']''" 'wiki-italic)
+ (cons "'''''[^ \t\n].*?[^ \t\n]'''''" 'wiki-bold-italic)
+ (cons "'''[^ \t\n'].*?[^ \t\n']'''" 'wiki-bold)
+ (cons "''[^ \t\n'].*?[^ \t\n']''" 'wiki-italic)
(cons "^ .*$" 'wiki-pre-face)
;; FIXME: not working, need to do something like `org-activate-links'
(cons "\\(\\[\\[\\)\\([^][|]+\\)\\(|\\)\\([^][|]+\\)\\(\\]\\]\\)"
@@ -75,21 +75,19 @@
(save-excursion
(goto-char (point-min))
(while (re-search-forward wiki-link-re nil t)
- (let ((matched (match-data))
- (target (match-string 1))
- (maybe-label (match-string 2)))
- (put-text-property
- (nth 0 matched)
- (nth (if maybe-label 4 2) matched)
- 'invisible t)
- (put-text-property
- (nth (if maybe-label 5 3) matched)
- (nth 1 matched)
- 'invisible t)
- (put-text-property
- (nth (if maybe-label 4 2) matched)
- (nth (if maybe-label 5 3) matched)
- 'font-lock-face 'wiki-link)))))
+ (let ((start (match-beginning 0))
+ (end (match-end 0))
+ (visible-start (or (match-beginning 2) (match-beginning 1)))
+ (visible-end (or (match-end 2) (match-end 1)))
+ )
+ (put-text-property start visible-start 'invisible t)
+ (put-text-property visible-start visible-end 'font-lock-face 'wiki-link)
+ (put-text-property visible-end end 'invisible t)
+ (add-text-properties (1- visible-start) visible-start
+ '(rear-nonsticky invisible))
+ (add-text-properties (1- visible-start) visible-start
+ '(rear-nonsticky invisible))
+ ))))
(define-derived-mode wiki-mode outline-mode "Wiki"
"A wikitext mode."