Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2017-09-07 15:55:20 +02:00
commit 9c5d03ca3b
1 changed files with 21 additions and 10 deletions

View File

@ -4381,8 +4381,9 @@ as a whole, to include whitespace.
with a colon, this will mean that the (non-regexp) snippets of the with a colon, this will mean that the (non-regexp) snippets of the
Boolean search must match as full words. Boolean search must match as full words.
This command searches the agenda files, and in addition the files listed This command searches the agenda files, and in addition the files
in `org-agenda-text-search-extra-files'." listed in `org-agenda-text-search-extra-files' unless a restriction lock
is active."
(interactive "P") (interactive "P")
(if org-agenda-overriding-arguments (if org-agenda-overriding-arguments
(setq todo-only (car org-agenda-overriding-arguments) (setq todo-only (car org-agenda-overriding-arguments)
@ -4492,10 +4493,20 @@ in `org-agenda-text-search-extra-files'."
(if hdl-only (setq regexp (concat org-outline-regexp-bol ".*?" (if hdl-only (setq regexp (concat org-outline-regexp-bol ".*?"
regexp)))) regexp))))
(setq files (org-agenda-files nil 'ifmode)) (setq files (org-agenda-files nil 'ifmode))
(when (eq (car org-agenda-text-search-extra-files) 'agenda-archives) ;; Add `org-agenda-text-search-extra-files' unless there is some
(pop org-agenda-text-search-extra-files) ;; restriction.
(setq files (org-add-archive-files files))) (unless (get 'org-agenda-files 'org-restrict)
(setq files (append files org-agenda-text-search-extra-files) (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
(pop org-agenda-text-search-extra-files)
(setq files (org-add-archive-files files))))
;; Uniquify files. However, let `org-check-agenda-file' handle
;; non-existent ones.
(setq files (cl-remove-duplicates
(append files org-agenda-text-search-extra-files)
(lambda (a b)
(and (file-exists-p a)
(file-exists-p b)
(file-equal-p a b))))
rtnall nil) rtnall nil)
(while (setq file (pop files)) (while (setq file (pop files))
(setq ee nil) (setq ee nil)
@ -4550,12 +4561,12 @@ in `org-agenda-text-search-extra-files'."
(point-at-bol) (point-at-bol)
(if hdl-only (point-at-eol) end))) (if hdl-only (point-at-eol) end)))
(mapc (lambda (wr) (when (string-match wr str) (mapc (lambda (wr) (when (string-match wr str)
(goto-char (1- end)) (goto-char (1- end))
(throw :skip t))) (throw :skip t)))
regexps-) regexps-)
(mapc (lambda (wr) (unless (string-match wr str) (mapc (lambda (wr) (unless (string-match wr str)
(goto-char (1- end)) (goto-char (1- end))
(throw :skip t))) (throw :skip t)))
(if todo-only (if todo-only
(cons (concat "^\\*+[ \t]+" (cons (concat "^\\*+[ \t]+"
org-not-done-regexp) org-not-done-regexp)