Режим организации: проблемы со складыванием (в текущей строке не найдено ни одного подходящего предмета) - PullRequest
0 голосов
/ 14 апреля 2020

У меня странная проблема с Emacs (doom-emacs) в macOS (brew cask emacs-ma c -spacemacs-icon): я время от времени не могу сложить заголовок. Я могу развернуть его, затем отображаются его дочерние элементы, однако, когда я пытаюсь сложить его, я получаю сообщение «Не найдено соответствующего элемента в текущей строке». Иногда, когда я переключаюсь в другое приложение и вкладываю обратно, строка сообщения показывает «FOLDED» и «CHILDREN», когда я нажимаю клавишу Tab.

Это также работает в некоторых файлах org, но не в других , Я не знаю, что между ними.

Я только что понял, что когда в качестве заголовка у меня неактивная временная метка, при нажатии на вкладку один раз отображаются дочерние элементы, а при повторном нажатии на нее просто прыгает между скобками ...

Вот моя конфигурация:

;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;;   presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
(setq doom-font (font-spec :family "Meslo LG M for Powerline"
                           :size 12))

;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-gruvbox)

;; Enable visual line mode per default for text files
(add-hook! 'text-mode-hook 'turn-on-visual-line-mode)

;; Enable org-autolist
(add-hook 'org-mode-hook (lambda () (org-autolist-mode)))

;; Org mode configuration
(setq org-directory "~/org")
(setq org-default-clock-file (concat org-directory "/clock.org"))
(after! org
  (setq org-agenda-files (list org-directory))
  (setq org-default-notes-file (concat org-directory "/inbox.org"))
  (setq org-task-file (concat org-directory "/tasks.org"))
  (setq org-log-into-drawer t)
  (setq org-log-done nil)
  (setq org-image-actual-width (/ (display-pixel-width) 3))

  (setq org-todo-keywords
        '((sequence "TODO(t)" "IN-PROGRESS(i!)" "WAITING(@w)" "|"
                    "DONE(d!)" "CANCELED(@c)")))
  (setq org-todo-keyword-faces
        '(
          ("TODO" . (:foreground "#fb4933" :weight bold))
          ("IN-PROGRESS" . (:foreground "#fabd2f" :weight bold))
          ("WAITING" . (:foreground "#fe8019" :weight bold))
          ("DONE" . (:foreground "#8ec07c" :weight bold))
          ("CANCELED" . (:foreground "#83a598" :weight bold))
          )
        )

  (setq org-capture-templates
        `(("r" "Weekly report" entry (file+headline org-default-clock-file "Clock")
           ,(concat "** Woche %<%V>\n"
                   "*** Gesamt\n"
                   "#+BEGIN: clocktable :scope agenda :maxlevel 20 :block 2020-W%<%V> :step week :stepskip0 t\n"
                   "#+END:\n"
                   "*** Tage\n"
                   "#+BEGIN: clocktable :scope agenda :maxlevel 20 :block 2020-W%<%V> :step day :stepskip0 t\n"
                   "#+END:"
                   )
           )))

  (setq org-startup-indented t)
  (setq org-clock-persist 'history)
  (org-clock-persistence-insinuate)
  (setq org-duration-format (quote h:mm))
  (setq org-refile-targets '((org-agenda-files :maxlevel . 10)))
  (setq org-goto-interface 'outline-path-completion)

  (defvar org-created-property-name "CREATED"
    "The name of the org-mode property that stores the creation date of the entry")

  (defun org-set-created-property (&optional active NAME)
    "Set a property on the entry giving the creation time.
           By default the property is called CREATED. If given the `NAME'
           argument will be used instead. If the property already exists, it
          will not be modified."
    (interactive)
    (let* ((created (or NAME org-created-property-name))
           (fmt (if active "<%s>" "[%s]"))
           (now  (format fmt (format-time-string "%Y-%m-%d %a %H:%M"))))
      (unless (org-entry-get (point) created nil)
        (org-set-property created now))))

  ;; Key mappings
  (map! :leader
        (:prefix ("o" . "org")
        :desc "Goto"                      "g" 'org-goto
        :desc "Insert inactive timestamp" "!" 'org-time-stamp-inactive
        :desc "Update dynamic block"      "u" 'org-dblock-update
        :desc "Todo list"                 "t" 'org-todo-list
        :desc "Agenda"                    "a" 'org-agenda
        :desc "Tag search"                "m" 'org-tags-view
        :desc "Search org headlines"      "h" #'+default/org-notes-headlines
        :desc "Search org files"          "s" #'+default/org-notes-search
        :desc "Refile"                    "r" 'org-refile
        :desc "Browse notes"              "f" #'+default/browse-notes
        :desc "Search notes for symbol"   "." #'+default/search-notes-for-symbol-at-point
        :desc "Org capture"               "n" #'org-capture
        (:prefix ("c" . "clock")
          :desc "Clock in" "i" 'org-clock-in
          :desc "Clock out" "o" 'org-clock-out
          :desc "Jump to last clock" "l" (lambda () (interactive) (setq current-prefix-arg '(4)) (org-clock-goto))
          :desc "Jump to active clock" "j" 'org-clock-goto)
        (:prefix ("p" . "properties")
          :desc "Set CREATED property"      "c" 'org-set-created-property)
        ))
  )

;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type t)

;; Key unmappings
(map! :leader "n" nil)
(map! :leader "o" nil)
...