Prechádzať zdrojové kódy

Delete `org-make-link' and replace previous occurrences by `concat'.

* org.el (org-make-link): Delete.
(org-store-link, org-insert-link)
(org-file-complete-link): Don't use `org-make-link'.

* org-wl.el (org-wl-store-link-folder)
(org-wl-store-link-message): Ditto.

* org-vm.el (org-vm-store-link): Ditto.

* org-rmail.el (org-rmail-store-link): Ditto.

* org-mhe.el (org-mhe-store-link): Ditto.

* org-mew.el (org-mew-store-link): Ditto.

* org-irc.el (org-irc-erc-store-link): Ditto.

* org-info.el (org-info-store-link): Ditto.

* org-id.el (org-id-store-link): Ditto.

* org-gnus.el (org-gnus-group-link, org-gnus-article-link):
Ditto.

* org-eshell.el (org-eshell-store-link): Ditto.

* org-bbdb.el (org-bbdb-store-link): Ditto.
Bastien Guerry 12 rokov pred
rodič
commit
96551f3dd8

+ 1 - 1
lisp/org-bbdb.el

@@ -207,7 +207,7 @@ date year)."
 	   (company (if (fboundp 'bbdb-record-getprop)
                         (bbdb-record-getprop rec 'company)
                       (car (bbdb-record-get-field rec 'organization))))
-	   (link (org-make-link "bbdb:" name)))
+	   (link (concat "bbdb:" name)))
       (org-store-link-props :type "bbdb" :name name :company company
 			    :link link :description name)
       link)))

+ 1 - 1
lisp/org-eshell.el

@@ -57,7 +57,7 @@
     (let* ((command (concat "cd " dired-directory))
            (link  (concat (buffer-name) ":" command)))
       (org-store-link-props
-       :link (org-make-link "eshell:" link)
+       :link (concat "eshell:" link)
        :description command))))
 
 (provide 'org-eshell)

+ 3 - 3
lisp/org-gnus.el

@@ -100,11 +100,11 @@ If `org-store-link' was called with a prefix arg the meaning of
     (if (and (string-match "^nntp" group) ;; Only for nntp groups
 	     (org-xor current-prefix-arg
 		      org-gnus-prefer-web-links))
-	(org-make-link (if (string-match "gmane" unprefixed-group)
+	(concat (if (string-match "gmane" unprefixed-group)
 			   "http://news.gmane.org/"
 			 "http://groups.google.com/group/")
 		       unprefixed-group)
-      (org-make-link "gnus:" group))))
+      (concat "gnus:" group))))
 
 (defun org-gnus-article-link (group newsgroups message-id x-no-archive)
   "Create a link to a Gnus article.
@@ -125,7 +125,7 @@ If `org-store-link' was called with a prefix arg the meaning of
 		  "http://mid.gmane.org/%s"
 		"http://groups.google.com/groups/search?as_umsgid=%s")
 	      (org-fixup-message-id-for-http message-id))
-    (org-make-link "gnus:" group "#" message-id)))
+    (concat "gnus:" group "#" message-id)))
 
 (defun org-gnus-store-link ()
   "Store a link to a Gnus folder or message."

+ 1 - 1
lisp/org-id.el

@@ -602,7 +602,7 @@ optional argument MARKERP, return the position as a new marker."
   "Store a link to the current entry, using its ID."
   (interactive)
   (when (and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode))
-    (let* ((link (org-make-link "id:" (org-id-get-create)))
+    (let* ((link (concat "id:" (org-id-get-create)))
 	   (case-fold-search nil)
 	   (desc (save-excursion
 		   (org-back-to-heading t)

+ 1 - 1
lisp/org-info.el

@@ -48,7 +48,7 @@
   "Store a link to an Info file and node."
   (when (eq major-mode 'Info-mode)
     (let (link desc)
-      (setq link (org-make-link "info:"
+      (setq link (concat "info:"
 				(file-name-nondirectory Info-current-file)
 				"#" Info-current-node))
       (setq desc (concat (file-name-nondirectory Info-current-file)

+ 1 - 1
lisp/org-irc.el

@@ -171,7 +171,7 @@ the session itself."
 	    (progn
 	      (org-store-link-props
 	       :type "irc"
-	       :link (org-make-link "irc:/" link-text)
+	       :link (concat "irc:/" link-text)
 	       :description (concat "irc session '" link-text "'")
 	       :server (car (car link))
 	       :port (or (string-to-number (cadr (pop link))) erc-default-port)

+ 1 - 2
lisp/org-mew.el

@@ -103,8 +103,7 @@
 			    :date-timestamp-inactive date-ts-ia))
       (setq message-id (org-remove-angle-brackets message-id))
       (setq desc (org-email-link-description))
-      (setq link (org-make-link "mew:" folder-name
-				"#" message-id))
+      (setq link (concat "mew:" folder-name "#" message-id))
       (org-add-link-props :link link :description desc)
       link)))
 

+ 1 - 1
lisp/org-mhe.el

@@ -99,7 +99,7 @@ supported by MH-E."
 	  (org-add-link-props :date date :date-timestamp date-ts
 			      :date-timestamp-inactive date-ts-ia))
 	(setq desc (org-email-link-description))
-	(setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#"
+	(setq link (concat "mhe:" (org-mhe-get-message-real-folder) "#"
 				  (org-remove-angle-brackets message-id)))
 	(org-add-link-props :link link :description desc)
 	link))))

+ 1 - 1
lisp/org-rmail.el

@@ -73,7 +73,7 @@
 				:date-timestamp-inactive date-ts-ia))
 	  (setq message-id (org-remove-angle-brackets message-id))
 	  (setq desc (org-email-link-description))
-	  (setq link (org-make-link "rmail:" folder "#" message-id))
+	  (setq link (concat "rmail:" folder "#" message-id))
 	  (org-add-link-props :link link :description desc)
 	  (rmail-show-message rmail-current-message)
 	  link)))))

+ 1 - 1
lisp/org-vm.el

@@ -100,7 +100,7 @@
 	  (org-add-link-props :date date :date-timestamp date-ts
 			      :date-timestamp-inactive date-ts-ia))
 	(setq desc (org-email-link-description))
-	(setq link (org-make-link (concat link-type ":") folder "#" message-id))
+	(setq link (concat (concat link-type ":") folder "#" message-id))
 	(org-add-link-props :link link :description desc)
 	link))))
 

+ 2 - 2
lisp/org-wl.el

@@ -161,7 +161,7 @@ ENTITY is a message entity."
   "Store a link to a WL folder."
   (let* ((folder (wl-folder-get-entity-from-buffer))
 	 (petname (wl-folder-get-petname folder))
-	 (link (org-make-link "wl:" folder)))
+	 (link (concat "wl:" folder)))
     (save-excursion
       (beginning-of-line)
       (unless (and (wl-folder-buffer-group-p)
@@ -246,7 +246,7 @@ ENTITY is a message entity."
 				    :subject subject :message-id message-id
 				    :message-id-no-brackets message-id-no-brackets)
 	      (setq desc (org-email-link-description))
-	      (setq link (org-make-link "wl:" folder-name "#" message-id-no-brackets))
+	      (setq link (concat "wl:" folder-name "#" message-id-no-brackets))
 	      (org-add-link-props :link link :description desc)))
 	    (when date
 	      (org-add-link-props :date date :date-timestamp date-ts

+ 12 - 16
lisp/org.el

@@ -8839,12 +8839,12 @@ For file links, arg negates `org-context-in-file-links'."
 			     (not (string-match "Untitled" (buffer-name))))
 			(buffer-name)
 		      (url-view-url t))
-	     link (org-make-link (url-view-url t)))
+	     link (url-view-url t))
        (org-store-link-props :type "w3" :url (url-view-url t)))
 
       ((eq major-mode 'w3m-mode)
        (setq cpltxt (or w3m-current-title w3m-current-url)
-	     link (org-make-link w3m-current-url))
+	     link w3m-current-url)
        (org-store-link-props :type "w3m" :url (url-view-url t)))
 
       ((setq search (run-hook-with-args-until-success
@@ -8856,7 +8856,7 @@ For file links, arg negates `org-context-in-file-links'."
       ((eq major-mode 'image-mode)
        (setq cpltxt (concat "file:"
 			    (abbreviate-file-name buffer-file-name))
-	     link (org-make-link cpltxt))
+	     link cpltxt)
        (org-store-link-props :type "image" :file buffer-file-name))
 
       ((eq major-mode 'dired-mode)
@@ -8868,7 +8868,7 @@ For file links, arg negates `org-context-in-file-links'."
 		      ;; otherwise, no file so use current directory.
 		      default-directory))
 	 (setq cpltxt (concat "file:" file)
-	       link (org-make-link cpltxt))))
+	       link cpltxt)))
 
       ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode))
        (setq custom-id (org-entry-get nil "CUSTOM_ID"))
@@ -8879,7 +8879,7 @@ For file links, arg negates `org-context-in-file-links'."
 		       (abbreviate-file-name
 			(buffer-file-name (buffer-base-buffer)))
 		       "::" (match-string 1))
-	       link (org-make-link cpltxt)))
+	       link cpltxt))
 	((and (featurep 'org-id)
 	      (or (eq org-link-to-org-use-id t)
 		  (and (org-called-interactively-p 'any)
@@ -8919,7 +8919,7 @@ For file links, arg negates `org-context-in-file-links'."
 				     (org-heading-components))) "NONE"))))
 	 (if (string-match "::\\'" cpltxt)
 	     (setq cpltxt (substring cpltxt 0 -2)))
-	 (setq link (org-make-link cpltxt)))))
+	 (setq link cpltxt))))
 
       ((buffer-file-name (buffer-base-buffer))
        ;; Just link to this file here.
@@ -8936,7 +8936,7 @@ For file links, arg negates `org-context-in-file-links'."
 	   (setq cpltxt
 		 (concat cpltxt "::" (org-make-org-heading-search-string txt))
 		 desc "NONE")))
-       (setq link (org-make-link cpltxt)))
+       (setq link cpltxt))
 
       ((org-called-interactively-p 'interactive)
        (error "Cannot link to a buffer which is not visiting a file"))
@@ -9042,10 +9042,6 @@ according to FMT (default from `org-email-link-description-format')."
 				    (reverse slines))) "\n")))))
     (mapconcat 'identity (org-split-string s "[ \t]+") " ")))
 
-(defun org-make-link (&rest strings)
-  "Concatenate STRINGS."
-  (apply 'concat strings))
-
 (defun org-make-link-string (link &optional description)
   "Make a link with brackets, consisting of LINK and DESCRIPTION."
   (unless (string-match "\\S-" link)
@@ -9362,7 +9358,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 
     (if (string-match org-plain-link-re link)
 	;; URL-like link, normalize the use of angular brackets.
-	(setq link (org-make-link (org-remove-angle-brackets link))))
+	(setq link (org-remove-angle-brackets link)))
 
     ;; Check if we are linking to the current file with a search option
     ;; If yes, simplify the link by using only the search option.
@@ -9431,16 +9427,16 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 					 (expand-file-name ".")))))
       (cond
        ((equal arg '(16))
-	(setq link (org-make-link
+	(setq link (concat
 		    "file:"
 		    (abbreviate-file-name (expand-file-name file)))))
        ((string-match (concat "^" (regexp-quote pwd1) "\\(.+\\)") file)
-	(setq link  (org-make-link "file:" (match-string 1 file))))
+	(setq link  (concat "file:" (match-string 1 file))))
        ((string-match (concat "^" (regexp-quote pwd) "\\(.+\\)")
 		      (expand-file-name file))
-	(setq link  (org-make-link
+	(setq link  (concat
 		     "file:" (match-string 1 (expand-file-name file)))))
-       (t (setq link (org-make-link "file:" file)))))
+       (t (setq link (concat "file:" file)))))
     link))
 
 (defun org-completing-read (&rest args)