Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Hello, Chunyang Xu writes: > Subject: [PATCH] Exclude '[' and ']' in `org-plain-link-re' > > * lisp/org.el (org-make-link-regexps): Do it. Applied. Thank you. Regards, -- Nicolas Goaziou
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Nicolas Goaziou writes: > Hello, > > Chunyang Xu writes: > >> I changed `org-plain-link-re' to make it not longer think "[" and "]" >> are valid characters in a URL, which solves the problem. > > Thank you. > > I solved the problem differently, but your suggestion still makes sense. > Would you mind making it a proper patch, using "git format-patch", with > a proper commit message? Don't forget to add TINYCHANGE cookie at the > end if you haven't signed papers yet. Here is the patch. >From c0b86176dc99f63385bcebc1ccbcb5d41f062a2c Mon Sep 17 00:00:00 2001 From: Chunyang Xu Date: Sun, 28 May 2017 12:10:58 +0800 Subject: [PATCH] Exclude '[' and ']' in `org-plain-link-re' * lisp/org.el (org-make-link-regexps): Do it. TINYCHANGE --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 102a9b265..c2818299e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5687,7 +5687,7 @@ This should be called after the variable `org-link-parameters' has changed." org-plain-link-re (concat "\\<" types-re ":" - "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)") + "\\([^][ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)") ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)") org-bracket-link-regexp "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" -- 2.13.0 > Regards, > > -- > Nicolas Goaziou
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Chunyang Xu writes: > Sure, I will do that when it is possible (Right now, I can not git-clone > org-mode's repository, > > ~$ git clone git://orgmode.org/org-mode.git > Cloning into 'org-mode'... > fatal: read error: Connection reset by peer Cloning via http still works, so try that instead. > and the mirror at http://repo.or.cz/w/org-mode.git is also outdated for > about 4 days). That most likely hits the same problem, which seems to be with the orgmode.org server. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Nicolas Goaziou writes: > Hello, > > Chunyang Xu writes: > >> I changed `org-plain-link-re' to make it not longer think "[" and "]" >> are valid characters in a URL, which solves the problem. > > Thank you. > > I solved the problem differently, but your suggestion still makes sense. > Would you mind making it a proper patch, using "git format-patch", with > a proper commit message? Don't forget to add TINYCHANGE cookie at the > end if you haven't signed papers yet. Sure, I will do that when it is possible (Right now, I can not git-clone org-mode's repository, ~$ git clone git://orgmode.org/org-mode.git Cloning into 'org-mode'... fatal: read error: Connection reset by peer and the mirror at http://repo.or.cz/w/org-mode.git is also outdated for about 4 days). > Regards, > > -- > Nicolas Goaziou
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
On Fri, May 26, 2017 at 6:04 AM Nicolas Goaziou wrote: > I solved the problem differently, but your suggestion still makes sense. > Would you mind making it a proper patch, using "git format-patch", with > a proper commit message? Don't forget to add TINYCHANGE cookie at the > end if you haven't signed papers yet. > Thanks. After the fix in http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=2d29269bb1b9af08011e091913798b6598e4b156, I don't need that org-highlight-links workaround any more. -- Kaushal Modi
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Hello, Chunyang Xu writes: > I changed `org-plain-link-re' to make it not longer think "[" and "]" > are valid characters in a URL, which solves the problem. Thank you. I solved the problem differently, but your suggestion still makes sense. Would you mind making it a proper patch, using "git format-patch", with a proper commit message? Don't forget to add TINYCHANGE cookie at the end if you haven't signed papers yet. Regards, -- Nicolas Goaziou
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
I changed `org-plain-link-re' to make it not longer think "[" and "]" are valid characters in a URL, which solves the problem. diff -u --label /Users/xcy/.emacs.d/elpa-25.2.1/org-plus-contrib-20170515/org.el --label \#\ /Users/xcy/.emacs.d/elpa-25.2.1/org-plus-contrib-20170515/org.el /var/folders/7f/s191h4q97p90374yw15ssrs0gn/T/buffer-content-71053Vt --- /Users/xcy/.emacs.d/elpa-25.2.1/org-plus-contrib-20170515/org.el +++ # @@ -5847,7 +5847,7 @@ org-plain-link-re (concat "\\<" types-re ":" - "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)") + "\\([^][ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)") ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)") org-bracket-link-regexp "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" Diff finished. Fri May 26 16:01:30 2017 林镇国 writes: > Remember to cover the basics, that is, what you expected to happen and > what in fact did happen. You don't know how to make a good report? See > > http://orgmode.org/manual/Feedback.html#Feedback > > Your bug report will be posted to the Org mailing list. > > > Hi! > > When I insert a link to my note, such as“这是一个[[link][链接]]啦~”, > the text after the link, "啦~", will be formatting as link style. > > Space participe is not work in some language, such as Chinese and > Japanese. If I use a space to participe the link the the text after > it, that's really ugly in Chinese. > > And I wonder even in English, must we add a space after a link? > > By the way, it just a formatting problem(with org-hide-emphasis-markers > is t), not export problem, the link export to html is ok! > > Emacs : GNU Emacs 25.2.1 (x86_64-apple-darwin13.4.0, Carbon Version 157 > AppKit 1265.21) > of 2017-02-06 > Package: Org mode version 9.0.5 (9.0.5-elpaplus @ > /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/) > > current state: > == > (setq > org-id-locations-file "/Users/mistkafka/.emacs.d/.cache/.org-id-locations" > org-tab-first-hook '(org-babel-hide-result-toggle-maybe > org-babel-header-arg-expand) > org-clock-persist-file "/Users/mistkafka/.emacs.d/.cache/org-clock-save.el" > org-speed-command-hook '(org-speed-command-default-hook > org-babel-speed-command-hook) > org-time-clocksum-format '(:hours "%d" :require-hours t :minutes ":%02d" > :require-minutes t) > org-occur-hook '(org-first-headline-recenter) > org-imenu-depth 8 > org-metaup-hook '(org-babel-load-in-session-maybe) > org-html-format-drawer-function '(closure >(htmlize-buffer-places > org-html-format-table-no-css htmlize-css-name-prefix htmlize-output-type > htmlize-output-type > htmlize-css-name-prefix t) >(_name contents) contents) > org-log-done t > org-latex-format-inlinetask-function > 'org-latex-format-inlinetask-default-function > org-confirm-shell-link-function 'yes-or-no-p > org-image-actual-width nil > org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default > org-link-translation-function 'toc-org-unhrefify > org-present-mode-hook '(spacemacs//org-present-start) > org-agenda-restore-windows-after-quit t > org-latex-format-headline-function 'org-latex-format-headline-default-function > org-default-notes-file "notes.org" > org-todo-keyword-faces '(("NEXT" :inherit warning) ("PROJECT" :inherit > font-lock-string-face)) > org-after-todo-state-change-hook '(org-clock-out-if-current) > org-latex-format-drawer-function '(closure (t) (_ contents) contents) > org-odt-format-headline-function 'org-odt-format-headline-default-function > org-todo-repeat-to-state "NEXT" > org-src-mode-hook '(org-src-babel-configure-edit-buffer > org-src-mode-configure-edit-buffer) > org-agenda-before-write-hook '(org-agenda-add-entry-text) > org-babel-pre-tangle-hook '(save-buffer) > org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook > change-major-mode-hook org-show-block-all append local] 5] > #[0 "\300\301\302\303\304$\207" [add-hook > change-major-mode-hook org-babel-show-result-all append local] 5] > org-babel-result-hide-spec > org-babel-hide-all-hashes spacemacs/load-yasnippet > toc-org-enable org-download-enable org-bullets-mode > spacemacs//org-babel-do-load-languages flyspell-mode > spacemacs/add-org-surrounds evil-org-mode org-eldoc-load > spacemacs//init-company-org-mode company-mode) > org-archive-hook '(org-attach-archive-delete-maybe) > org-ascii-format-drawer-function '(closure (t) (_name contents _width) > contents) > org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function > org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers > org-cycle-show-empty-lines org-optimize-window-after-visibility-change) > org-publish-tim
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Kaushal Modi writes: > On Wed, May 24, 2017 at 9:50 AM Chunyang Xu wrote: > >> >> Nicolas Goaziou writes: >> >> > Hello, >> > >> > 林镇国 writes: >> > >> >> When I insert a link to my note, such as“这是一个[[link][链接]]啦~”, >> >> the text after the link, "啦~", will be formatting as link style. >> > >> > FWIW, I cannot reproduce it, i.e., only "链接" appears with a link face. >> >> I can reproduce if "link" is a real link and "description" doesn't >> contain white space, for example, >> >> [[http://example.com/][Example]]blah >> >> Also under the org-link face >> >> It looks like `org-plain-link-re' doesn't think a link is end unless >> a punctuation character is found: >> >> org-plain-link-re >> (concat >> "\\<" types-re ":" >> "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] >> \t\n]\\|/\\)\\)\\)") >> ^ >> >> It is a reasonable assumption for English, but not for Chinese. >> > > I actually stumbled across this few days back, and when using English > language :) > > Here's a solution that might work for you too (and my notes on why I set > this): > > ;; The default value of `org-highlight-links' contains `plain' too. > ;; - "plain" links are links in normal text, no whitespace, like > http://foo.com. > ;; Here's why I remove "plain" from this list: > ;; - If I have two bracketed links next to each-other in org-mode (like > below), > ;; [[http://google.com][1]],[[http://orgmode.org][2]] > ;; - and, if `plain' is in the `org-highlight-links' list, > ;; the "," in there will also be highlighted as a link. So it would look > ;; as if the "1,2" string pointed to a single link! > ;;But without `plain' as part of this list, the "1" and "2" strings will > ;; look like separate links (as should be the case), as the "," will not be > ;; highlighted as a link. > (setq org-highlight-links (delete 'plain org-highlight-links)) Oh, I didn't know the user option, I just added it to my init file. Thanks. > > -- > > Kaushal Modi
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
On Wed, May 24, 2017 at 9:50 AM Chunyang Xu wrote: > > Nicolas Goaziou writes: > > > Hello, > > > > 林镇国 writes: > > > >> When I insert a link to my note, such as“这是一个[[link][链接]]啦~”, > >> the text after the link, "啦~", will be formatting as link style. > > > > FWIW, I cannot reproduce it, i.e., only "链接" appears with a link face. > > I can reproduce if "link" is a real link and "description" doesn't > contain white space, for example, > > [[http://example.com/][Example]]blah > > Also under the org-link face > > It looks like `org-plain-link-re' doesn't think a link is end unless > a punctuation character is found: > > org-plain-link-re > (concat > "\\<" types-re ":" > "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] > \t\n]\\|/\\)\\)\\)") > ^ > > It is a reasonable assumption for English, but not for Chinese. > I actually stumbled across this few days back, and when using English language :) Here's a solution that might work for you too (and my notes on why I set this): ;; The default value of `org-highlight-links' contains `plain' too. ;; - "plain" links are links in normal text, no whitespace, like http://foo.com. ;; Here's why I remove "plain" from this list: ;; - If I have two bracketed links next to each-other in org-mode (like below), ;; [[http://google.com][1]],[[http://orgmode.org][2]] ;; - and, if `plain' is in the `org-highlight-links' list, ;; the "," in there will also be highlighted as a link. So it would look ;; as if the "1,2" string pointed to a single link! ;;But without `plain' as part of this list, the "1" and "2" strings will ;; look like separate links (as should be the case), as the "," will not be ;; highlighted as a link. (setq org-highlight-links (delete 'plain org-highlight-links)) -- Kaushal Modi
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Nicolas Goaziou writes: > Hello, > > 林镇国 writes: > >> When I insert a link to my note, such as“这是一个[[link][链接]]啦~”, >> the text after the link, "啦~", will be formatting as link style. > > FWIW, I cannot reproduce it, i.e., only "链接" appears with a link face. I can reproduce if "link" is a real link and "description" doesn't contain white space, for example, [[http://example.com/][Example]]blah Also under the org-link face It looks like `org-plain-link-re' doesn't think a link is end unless a punctuation character is found: org-plain-link-re (concat "\\<" types-re ":" "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)") ^ It is a reasonable assumption for English, but not for Chinese. > Regards,
Re: [O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Hello, 林镇国 writes: > When I insert a link to my note, such as“这是一个[[link][链接]]啦~”, > the text after the link, "啦~", will be formatting as link style. FWIW, I cannot reproduce it, i.e., only "链接" appears with a link face. Regards, -- Nicolas Goaziou
[O] Bug: link formating problem [9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. Hi! When I insert a link to my note, such as“这是一个[[link][链接]]啦~”, the text after the link, "啦~", will be formatting as link style. Space participe is not work in some language, such as Chinese and Japanese. If I use a space to participe the link the the text after it, that's really ugly in Chinese. And I wonder even in English, must we add a space after a link? By the way, it just a formatting problem(with org-hide-emphasis-markers is t), not export problem, the link export to html is ok! Emacs : GNU Emacs 25.2.1 (x86_64-apple-darwin13.4.0, Carbon Version 157 AppKit 1265.21) of 2017-02-06 Package: Org mode version 9.0.5 (9.0.5-elpaplus @ /Users/mistkafka/.emacs.d/elpa/org-plus-contrib-20170210/) current state: == (setq org-id-locations-file "/Users/mistkafka/.emacs.d/.cache/.org-id-locations" org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-clock-persist-file "/Users/mistkafka/.emacs.d/.cache/org-clock-save.el" org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-time-clocksum-format '(:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t) org-occur-hook '(org-first-headline-recenter) org-imenu-depth 8 org-metaup-hook '(org-babel-load-in-session-maybe) org-html-format-drawer-function '(closure (htmlize-buffer-places org-html-format-table-no-css htmlize-css-name-prefix htmlize-output-type htmlize-output-type htmlize-css-name-prefix t) (_name contents) contents) org-log-done t org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-confirm-shell-link-function 'yes-or-no-p org-image-actual-width nil org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-link-translation-function 'toc-org-unhrefify org-present-mode-hook '(spacemacs//org-present-start) org-agenda-restore-windows-after-quit t org-latex-format-headline-function 'org-latex-format-headline-default-function org-default-notes-file "notes.org" org-todo-keyword-faces '(("NEXT" :inherit warning) ("PROJECT" :inherit font-lock-string-face)) org-after-todo-state-change-hook '(org-clock-out-if-current) org-latex-format-drawer-function '(closure (t) (_ contents) contents) org-odt-format-headline-function 'org-odt-format-headline-default-function org-todo-repeat-to-state "NEXT" org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes spacemacs/load-yasnippet toc-org-enable org-download-enable org-bullets-mode spacemacs//org-babel-do-load-languages flyspell-mode spacemacs/add-org-surrounds evil-org-mode org-eldoc-load spacemacs//init-company-org-mode company-mode) org-archive-hook '(org-attach-archive-delete-maybe) org-ascii-format-drawer-function '(closure (t) (_name contents _width) contents) org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-publish-timestamp-directory "/Users/mistkafka/.emacs.d/.cache/.org-timestamps/" org-present-mode-quit-hook '(spacemacs//org-present-end) org-export-async-init-file "/Users/mistkafka/.emacs.d/layers/+emacs/org/local/org-async-init.el" org-download-annotate-function 'org-download-annotate-default org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d@/!)") (sequence "PROJECT(p)" "|" "DONE(d@/!)" "CANCELLED(c@/!)") (sequence "WAITING(w@/!)" "DELEGATED(e!)" "HOLD(h)" "|" "CANCELLED(c@/!)")) org-hide-emphasis-markers t org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el") ("elisp" . "el")) org-confirm-elisp-link-function 'yes-or-no-p org-startup-with-inline-images t org-metadown-hook '(org-babel-pop-to-session-maybe) org-log-into-drawer t org-odt-format-drawer-function '(closure (hfy-user-sheet-assoc hfy-html-quote-regex hfy-html-quote-map hfy-face-to-css hfy-begin-span-handler hfy-end-span-handler archive-zip-extract nxml-auto-insert-xml-declaration-flag t)