pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
|
||||
;; Author: Lars Tveito <larstvei@ifi.uio.no>
|
||||
;; URL: http://github.com/larstvei/Focus
|
||||
;; Package-Version: 20191209.2210
|
||||
;; Package-Commit: 5f3f20e7f22fb9fd7c48abce8bd38061d97e4bc0
|
||||
;; Package-Version: 20221016.1846
|
||||
;; Package-Commit: 2507ec4ec5a9402647ef85540669db1815520c15
|
||||
;; Created: 11th May 2015
|
||||
;; Version: 1.0.0
|
||||
;; Version: 1.0.1
|
||||
;; Package-Requires: ((emacs "24.3") (cl-lib "0.5"))
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
@@ -40,29 +40,31 @@
|
||||
:group 'font-lock
|
||||
:prefix "focus-")
|
||||
|
||||
(defcustom focus-mode-to-thing '((prog-mode . defun) (text-mode . sentence))
|
||||
(defcustom focus-mode-to-thing '((prog-mode . defun)
|
||||
(text-mode . paragraph)
|
||||
(org-mode . org-element))
|
||||
"An associated list between mode and thing.
|
||||
|
||||
A thing is defined in thingatpt.el; the thing determines the
|
||||
narrowness of the focused section.
|
||||
|
||||
Note that the order of the list matters. The first mode that the
|
||||
Note that the order of the list matters. The first mode that the
|
||||
current mode is derived from is used, so more modes that have
|
||||
many derivatives should be placed by the end of the list.
|
||||
|
||||
Things that are defined include `symbol', `list', `sexp',
|
||||
`defun', `filename', `url', `email', `word', `sentence',
|
||||
`whitespace', `line', and `page'."
|
||||
:type '(repeat symbol)
|
||||
:type '(alist :key-type symbol :valye-type symbol)
|
||||
:group 'focus)
|
||||
|
||||
(defcustom focus-read-only-blink-seconds 1
|
||||
"The duration of a cursor blink in `focus-read-only-mode'."
|
||||
:type '(float)
|
||||
:type 'number
|
||||
:group 'focus)
|
||||
|
||||
(defface focus-unfocused
|
||||
'((t :inherit font-lock-comment-face))
|
||||
'((t :inherit shadow))
|
||||
"The face that overlays the unfocused area."
|
||||
:group 'focus)
|
||||
|
||||
@@ -71,7 +73,7 @@ Things that are defined include `symbol', `list', `sexp',
|
||||
:group 'focus)
|
||||
|
||||
(defvar focus-cursor-type cursor-type
|
||||
"Used to restore the users `cursor-type'")
|
||||
"Used to restore the users `cursor-type'.")
|
||||
|
||||
(defvar-local focus-current-thing nil
|
||||
"Overrides the choice of thing dictated by `focus-mode-to-thing' if set.")
|
||||
@@ -103,7 +105,13 @@ The timer calls `focus-read-only-hide-cursor' after
|
||||
|
||||
(defun focus-bounds ()
|
||||
"Return the current bounds, based on `focus-get-thing'."
|
||||
(bounds-of-thing-at-point (focus-get-thing)))
|
||||
(let ((thing (focus-get-thing)))
|
||||
(cond ((eq thing 'org-element)
|
||||
(let* ((elem (org-element-at-point))
|
||||
(beg (org-element-property :begin elem))
|
||||
(end (org-element-property :end elem)))
|
||||
(cons beg end)))
|
||||
(t (bounds-of-thing-at-point (focus-get-thing))))))
|
||||
|
||||
(defun focus-move-focus ()
|
||||
"Move the focused section according to `focus-bounds'.
|
||||
@@ -116,7 +124,7 @@ command."
|
||||
(focus-move-overlays (car bounds) (cdr bounds))))))
|
||||
|
||||
(defun focus-move-overlays (low high)
|
||||
"Move `focus-pre-overlay', `focus-mid-overlay' and `focus-post-overlay'."
|
||||
"Move the overlays to highlight the region between LOW and HIGH."
|
||||
(move-overlay focus-pre-overlay (point-min) low)
|
||||
(move-overlay focus-mid-overlay low high)
|
||||
(move-overlay focus-post-overlay high (point-max)))
|
||||
@@ -126,7 +134,7 @@ command."
|
||||
|
||||
It sets the `focus-pre-overlay', `focus-min-overlay', and
|
||||
`focus-post-overlay' to overlays; these are invisible until
|
||||
`focus-move-focus' is run. It adds `focus-move-focus' to
|
||||
`focus-move-focus' is run. It adds `focus-move-focus' to
|
||||
`post-command-hook'."
|
||||
(unless (or focus-pre-overlay focus-post-overlay)
|
||||
(setq focus-pre-overlay (make-overlay (point-min) (point-min))
|
||||
@@ -163,11 +171,11 @@ The overlays pointed to by `focus-pre-overlay',
|
||||
"Adjust the narrowness of the focused section for the current buffer.
|
||||
|
||||
The variable `focus-mode-to-thing' dictates the default thing
|
||||
according to major-mode. If `focus-current-thing' is set, this
|
||||
default is overwritten. This function simply helps set the
|
||||
according to major-mode. If `focus-current-thing' is set, this
|
||||
default is overwritten. This function simply helps set the
|
||||
`focus-current-thing'."
|
||||
(interactive)
|
||||
(let* ((candidates '(defun line list paragraph sentence sexp symbol word))
|
||||
(let* ((candidates '(defun line list org-element paragraph sentence sexp symbol word))
|
||||
(thing (completing-read "Thing: " candidates)))
|
||||
(setq focus-current-thing (intern thing))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user