0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-28 19:00:55 +00:00

org-mobile: Silence byte-compiler

* lisp/org-mobile.el (org-mobile-apply): Silence byte-compiler.
This commit is contained in:
Nicolas Goaziou 2016-08-08 13:29:09 +02:00
parent 9b5f964d71
commit 2538ffae65

View file

@ -822,18 +822,19 @@ If BEG and END are given, only do this in that region."
(id-pos (condition-case msg (id-pos (condition-case msg
(org-mobile-locate-entry (match-string 4)) (org-mobile-locate-entry (match-string 4))
(error (nth 1 msg)))) (error (nth 1 msg))))
(bos (point-at-bol)) (bos (line-beginning-position))
(eos (save-excursion (org-end-of-subtree t t))) (eos (save-excursion (org-end-of-subtree t t)))
(cmd (if (equal action "") (cmd (if (equal action "")
(lambda (_data _old _new) (let ((note (buffer-substring-no-properties
(cl-incf cnt-flag) (line-beginning-position 2) eos)))
(org-toggle-tag "FLAGGED" 'on) (lambda (_data _old _new)
(when note (cl-incf cnt-flag)
(org-entry-put nil "THEFLAGGINGNOTE" note))) (org-toggle-tag "FLAGGED" 'on)
(org-entry-put
nil "THEFLAGGINGNOTE"
(replace-regexp-in-string "\n" "\\\\n" note))))
(cl-incf cnt-edit) (cl-incf cnt-edit)
(cdr (assoc action org-mobile-action-alist)))) (cdr (assoc action org-mobile-action-alist))))
(note (and (equal action "")
(buffer-substring (1+ (point-at-eol)) eos)))
;; Do not take notes interactively. ;; Do not take notes interactively.
(org-inhibit-logging 'note) (org-inhibit-logging 'note)
old new) old new)
@ -867,11 +868,6 @@ If BEG and END are given, only do this in that region."
(point))))) (point)))))
(setq old (org-string-nw-p old)) (setq old (org-string-nw-p old))
(setq new (org-string-nw-p new)) (setq new (org-string-nw-p new))
(if (and note (> (length note) 0))
;; Make Note into a single line, to fit into a property
(setq note (mapconcat 'identity
(org-split-string (org-trim note) "\n")
"\\n")))
(unless (equal data "body") (unless (equal data "body")
(setq new (and new (org-trim new))) (setq new (and new (org-trim new)))
(setq old (and old (org-trim old)))) (setq old (and old (org-trim old))))
@ -882,7 +878,8 @@ If BEG and END are given, only do this in that region."
(condition-case msg (condition-case msg
(org-with-point-at id-pos (org-with-point-at id-pos
(funcall cmd data old new) (funcall cmd data old new)
(unless (member data '("delete" "archive" "archive-sibling" "addheading")) (unless (member data '("delete" "archive" "archive-sibling"
"addheading"))
(when (member "FLAGGED" (org-get-tags)) (when (member "FLAGGED" (org-get-tags))
(add-to-list 'org-mobile-last-flagged-files (add-to-list 'org-mobile-last-flagged-files
(buffer-file-name))))) (buffer-file-name)))))
@ -903,8 +900,8 @@ If BEG and END are given, only do this in that region."
(save-buffer) (save-buffer)
(move-marker marker nil) (move-marker marker nil)
(move-marker end nil) (move-marker end nil)
(message "%d new, %d edits, %d flags, %d errors" cnt-new (message "%d new, %d edits, %d flags, %d errors"
cnt-edit cnt-flag cnt-error) cnt-new cnt-edit cnt-flag cnt-error)
(sit-for 1))) (sit-for 1)))
(defun org-mobile-timestamp-buffer (buf) (defun org-mobile-timestamp-buffer (buf)