Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2022-01-12 21:11:33 +08:00
commit a9b2e262cd
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
5 changed files with 40 additions and 11 deletions

View File

@ -89,6 +89,8 @@
(declare-function org-capture "org-capture" (&optional goto keys))
(declare-function org-clock-modify-effort-estimate "org-clock" (&optional value))
(declare-function org-element-type "org-element" (&optional element))
(defvar calendar-mode-map)
(defvar org-clock-current-task)
(defvar org-current-tag-alist)
@ -5743,7 +5745,8 @@ displayed in agenda view."
(org-at-planning-p)
(org-before-first-heading-p)
(and org-agenda-include-inactive-timestamps
(org-at-clock-log-p)))
(org-at-clock-log-p))
(not (eq 'timestamp (org-element-type (org-element-context)))))
(throw :skip nil))
(org-agenda-skip))
(let* ((pos (match-beginning 0))

View File

@ -18951,17 +18951,19 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
"Is S an ID created by UUIDGEN?"
(string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s)))
(defun org-in-src-block-p (&optional inside)
(defun org-in-src-block-p (&optional inside element)
"Whether point is in a code source block.
When INSIDE is non-nil, don't consider we are within a source
block when point is at #+BEGIN_SRC or #+END_SRC."
(let ((case-fold-search t))
(or (and (eq (get-char-property (point) 'src-block) t))
(and (not inside)
(save-match-data
(save-excursion
(beginning-of-line)
(looking-at ".*#\\+\\(begin\\|end\\)_src")))))))
block when point is at #+BEGIN_SRC or #+END_SRC.
When ELEMENT is provided, it is considered to be element at point."
(save-match-data (setq element (or element (org-element-at-point))))
(when (eq 'src-block (org-element-type element))
(or (not inside)
(not (or (= (line-beginning-position)
(org-element-property :post-affiliated element))
(= (1+ (line-end-position))
(- (org-element-property :end element)
(org-element-property :post-blank element))))))))
(defun org-context ()
"Return a list of contexts of the current cursor position.

View File

@ -1,6 +1,6 @@
;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine -*- lexical-binding: t; -*-
;; Copyright (C) 2007-2022 Free Software Foundation, Inc.
;; Copyright (C) 2007-2022 Free Software Foundation, Inc.
;; Author: Nicolas Goaziou <n.goaziou AT gmail DOT com>
;; Alan Schmitt <alan.schmitt AT polytechnique DOT org>

View File

@ -6,3 +6,13 @@ SCHEDULED: <2017-07-19 Wed>
** subnote
* test code 216bc1ff1d862e78183e38ee9a4da504919b9878
<2019-01-08 Tue>
* test agenda non-scheduled
#+begin_src org
SCHEDULED: <2022-01-03 Mon>
#+end_src
* colon scheduled entry
: SCHEDULED: <2022-01-03 Mon>
* begin_example scheduled entry
#+begin_example
SCHEDULED: <2022-01-03 Mon>
#+end_example

View File

@ -92,6 +92,20 @@
(looking-at " *agenda-file:Scheduled: *test agenda"))))
(org-test-agenda--kill-all-agendas))
(ert-deftest test-org-agenda/non-scheduled-re-matces ()
"Make sure that scheduled-looking elements do not appear in agenda.
See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t."
(cl-assert (not org-agenda-sticky) nil "precondition violation")
(cl-assert (not (org-test-agenda--agenda-buffers))
nil "precondition violation")
(let ((org-agenda-span 'day)
(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
org-test-dir))))
(org-agenda-list nil "<2022-01-03 Mon>")
(set-buffer org-agenda-buffer-name)
(should (= 2 (count-lines (point-min) (point-max)))))
(org-test-agenda--kill-all-agendas))
(ert-deftest test-org-agenda/set-priority ()
"One informative line in the agenda. Check that org-agenda-priority updates the agenda."
(cl-assert (not org-agenda-sticky) nil "precondition violation")