组织模式:折叠问题(当前行未找到匹配项)

时间:2020-04-14 07:24:25

标签: emacs org-mode

我在macOS上的Emacs(doom-emacs)出现了一个奇怪的问题(酒桶emacs-mac-spacemacs-icon):我偶尔无法折叠标题。我可以展开它,然后显示它的子项,但是,当我尝试折叠它时,出现消息“在当前行上找不到匹配的项目”。有时,在切换到另一个应用程序并跳回后,它又可以工作,当我按Tab键时,消息行显示“已折叠”和“孩子”。

它在某些组织文件中也可以使用,但在其他组织文件中则不可用。我不知道它们之间有什么区别。

我刚刚意识到,当我将非活动时间戳记作为标题时,按Tab一次会显示子项,但再次按Tab则会在括号之间跳转...

这是我的配置:

;; 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)

1 个答案:

答案 0 :(得分:0)

我在厄运时遇到了这个问题,因为与 邪恶跳跃项目。我通过重新绑定标签来修复它:

(map! :after evil-org
  :map org-mode-map
  :desc "org-cycle" :n [tab] #'org-cycle)