(unless (fboundp field)
;; what's the record's existing value for this field?
(setq rec-val (bbdb-record-field r field)))
- (when (cond
- ((eq field 'address)
- (dolist (a rec-val)
- (unless (and label
- (not (string-match label (car a))))
- (string-match val (bbdb-format-address-default a)))))
- ((eq field 'phone)
- (dolist (p rec-val)
- (unless (and label
- (not (string-match label (car p))))
- (string-match val (bbdb-phone-string p)))))
- ((consp rec-val)
- (dolist (f rec-val)
- (string-match val f)))
- ((fboundp field)
- (funcall field r))
- ((stringp rec-val)
- (string-match val rec-val)))
+ (when (catch 'match
+ (cond
+ ((eq field 'address)
+ (dolist (a rec-val)
+ (unless (and label
+ (not (string-match label (car a))))
+ (when
+ (string-match-p
+ val
+ (bbdb-format-address-default a))
+ (throw 'match t)))))
+ ((eq field 'phone)
+ (dolist (p rec-val)
+ (unless (and label
+ (not (string-match label (car p))))
+ (when
+ (string-match-p val (bbdb-phone-string p))
+ (throw 'match t)))))
+ ((consp rec-val)
+ (dolist (f rec-val)
+ (when (string-match-p val f)
+ (throw 'match t))))
+ ((fboundp field)
+ (when (string-match-p (funcall field r))
+ (throw 'match t)))
+ ((stringp rec-val)
+ (when (string-match-p val rec-val)
+ (throw 'match t)))))
;; there are matches, run through the field setters in last
;; element of the sexp
(dolist (attribute style)
strings)
((numberp gnorb-org-mail-scan-scope)
(cl-subseq
- strings 0 (min
- (length strings)
- (1+ gnorb-org-mail-scan-scope))))
+ (nreverse strings)
+ 0 (min
+ (length strings)
+ (1+ gnorb-org-mail-scan-scope))))
;; We could provide more options here. 'tree vs
;; 'subtree, for instance.
(t
;; insert text, if any
(when text
(message-goto-body)
- (insert"\n")
+ (insert "\n")
(if (bufferp text)
(insert-buffer-substring text)
(insert text)))
;; got too much hard-coded stuff.
(interactive "P")
(org-back-to-heading t)
- (let* ((backend-string
+ (let* ((bkend-var
+ (if (boundp 'org-export--registered-backends)
+ org-export--registered-backends
+ org-export-registered-backends))
+ (backend-string
(org-completing-read
"Export backend: "
(mapcar (lambda (b)
(symbol-name (org-export-backend-name b)))
- org-export--registered-backends)
- nil t))
+ bkend-var)
+ nil t))
(backend-symbol (intern backend-string))
(f-or-t (org-completing-read "Export as file or text? "
'("file" "text") nil t))
,@opts
,gnorb-org-email-subtree-file-parameters))))
text file)
- (setq gnorb-window-conf (current-window-configuration))
- (move-marker gnorb-return-marker (point))
(if (bufferp result)
(setq text result)
(setq file result))
(let ((messages (length (gnorb-registry-tracked-messages)))
(headings (length (gnorb-registry-tracked-headings)))
(reg-size (registry-size gnus-registry-db))
- (reg-max-size (oref gnus-registry-db max-size)))
+ (reg-max-size (if (slot-exists-p gnus-registry-db 'max-size)
+ (oref gnus-registry-db max-size)
+ (oref gnus-registry-db max-hard))))
(with-current-buffer "*Gnorb Usage*"
(let ((inhibit-read-only t))
(erase-buffer)
"Return pretty outline path of the Org heading indicated by ID.
If the KW argument is true, add the TODO keyword into the path."
- (org-with-point-at (org-id-find id t)
- (let ((el (org-element-at-point)))
- (concat
- (if kw
- (format "(%s): "
- (org-element-property :todo-keyword el))
- "")
- (org-format-outline-path
- (append
- (list
- (file-name-nondirectory
- (buffer-file-name
- (org-base-buffer (current-buffer)))))
- (org-get-outline-path)
- (list
- (replace-regexp-in-string
- org-bracket-link-regexp
- "\\3" (org-element-property :raw-value el)))))))))
+ (let ((pt (org-id-find id t)))
+ (if pt
+ (org-with-point-at pt
+ (let ((el (org-element-at-point)))
+ (concat
+ (if kw
+ (format "(%s): "
+ (org-element-property :todo-keyword el))
+ "")
+ (org-format-outline-path
+ (append
+ (list
+ (file-name-nondirectory
+ (buffer-file-name
+ (org-base-buffer (current-buffer)))))
+ (org-get-outline-path)
+ (list
+ (replace-regexp-in-string
+ org-bracket-link-regexp
+ "\\3" (org-element-property :raw-value el))))))))
+ "[none]")))
(defun gnorb-scan-links (bound &rest types)
"Scan from point to BOUND looking for links of type in TYPES.
;; this summary buffer.
(buffer-local-value
'nngnorb-attachment-file-list
- (get-buffer nnir-tmp-buffer))))
+ (get-buffer-create nnir-tmp-buffer))))
(define-key gnorb-summary-minor-mode-map
[remap gnus-summary-exit]