Prechádzať zdrojové kódy

Allow links to contain brackets

Links in the standard form [[link][description]] are allowed to have
brackets in them when these are escapes %5B and %5D.  Creating links
through the Org link interface automatically does this conversion.

However, as noticed by Paul R, there is a bug when actually following
such links, when the link will be cut off at the first closing bracket
in the link.

This patch fixes this problem by adjusting the appropriate regexp.
Carsten Dominik 16 rokov pred
rodič
commit
de9e605297
2 zmenil súbory, kde vykonal 7 pridanie a 2 odobranie
  1. 5 0
      lisp/ChangeLog
  2. 2 2
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-11-06  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-make-link-regexps): Make sure that links to gnus can
+	contain brackets.
+
 2008-11-05  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-attach.el (org-attach-dir): Remove duplicate ID creation

+ 2 - 2
lisp/org.el

@@ -3429,7 +3429,7 @@ This should be called after the variable `org-link-types' has changed."
 	(concat
 	 "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
 	 "\\([^" org-non-link-chars " ]"
-	 "[^]\t\n\r]*"
+	 "[^\t\n\r]*"
 	 "[^" org-non-link-chars " ]\\)>?")
 	org-angle-link-re
 	(concat
@@ -5962,7 +5962,6 @@ Possible values in the list of contexts are `table', `headline', and `item'."
 
 (defun org-link-expand-abbrev (link)
   "Apply replacements as defined in `org-link-abbrev-alist."
-  (debug)
   (if (string-match "^\\([a-zA-Z][-_a-zA-Z0-9]*\\)\\(::?\\(.*\\)\\)?$" link)
       (let* ((key (match-string 1 link))
 	     (as (or (assoc key org-link-abbrev-alist-local)
@@ -6647,6 +6646,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file.
 With a double prefix argument, try to open outside of Emacs, in the
 application the system uses for this file type."
   (interactive "P")
+  (debug)
   (org-load-modules-maybe)
   (move-marker org-open-link-marker (point))
   (setq org-window-config-before-follow-link (current-window-configuration))