Kaynağa Gözat

org-id.el (org-id-update-id-locations): New parameter to silent `org-id-find'.

* org-id.el (org-id-update-id-locations): New parameter to
silent `org-id-find'.
(org-id-find): Use the new parameter.

Thanks to Sébastien Vauban for raising a related issue.
Bastien Guerry 13 yıl önce
ebeveyn
işleme
58bef074a7
1 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 5 4
      lisp/org-id.el

+ 5 - 4
lisp/org-id.el

@@ -273,7 +273,7 @@ With optional argument MARKERP, return the position as a new marker."
     (when file
     (when file
       (setq where (org-id-find-id-in-file id file markerp)))
       (setq where (org-id-find-id-in-file id file markerp)))
     (unless where
     (unless where
-      (org-id-update-id-locations)
+      (org-id-update-id-locations nil t)
       (setq file (org-id-find-id-file id))
       (setq file (org-id-find-id-file id))
       (when file
       (when file
 	(setq where (org-id-find-id-in-file id file markerp))))
 	(setq where (org-id-find-id-in-file id file markerp))))
@@ -403,7 +403,7 @@ and time is the usual three-integer representation of time."
 
 
 ;; Storing ID locations (files)
 ;; Storing ID locations (files)
 
 
-(defun org-id-update-id-locations (&optional files)
+(defun org-id-update-id-locations (&optional files silent)
   "Scan relevant files for IDs.
   "Scan relevant files for IDs.
 Store the relation between files and corresponding IDs.
 Store the relation between files and corresponding IDs.
 This will scan all agenda files, all associated archives, and all
 This will scan all agenda files, all associated archives, and all
@@ -441,8 +441,9 @@ When CHECK is given, prepare detailed information about duplicate IDs."
 	(setq files (delq 'agenda-archives (copy-sequence files))))
 	(setq files (delq 'agenda-archives (copy-sequence files))))
       (setq nfiles (length files))
       (setq nfiles (length files))
       (while (setq file (pop files))
       (while (setq file (pop files))
-	(message "Finding ID locations (%d/%d files): %s"
-		 (- nfiles (length files)) nfiles file)
+	(unless silent
+	  (message "Finding ID locations (%d/%d files): %s"
+		   (- nfiles (length files)) nfiles file))
 	(setq tfile (file-truename file))
 	(setq tfile (file-truename file))
 	(when (and (file-exists-p file) (not (member tfile seen)))
 	(when (and (file-exists-p file) (not (member tfile seen)))
 	  (push tfile seen)
 	  (push tfile seen)