pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -39,16 +39,17 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile
|
||||
(eval-and-compile
|
||||
(when (< emacs-major-version 26)
|
||||
(require 'cl))
|
||||
(require 'cl-lib)
|
||||
(require 'tramp)
|
||||
(require 'subr-x))
|
||||
(require 'subr-x)
|
||||
(require 'ess-utils))
|
||||
(require 'comint)
|
||||
(require 'compile)
|
||||
(require 'ring)
|
||||
(require 'ess-utils)
|
||||
|
||||
|
||||
(defvar text-scale-mode-amount)
|
||||
(autoload 'text-scale-mode "face-remap" "[autoload]" nil)
|
||||
@@ -91,6 +92,7 @@
|
||||
(declare-function ess-r-package-source-dirs "ess-r-package")
|
||||
(declare-function ess-roxy--region-p "ess-roxy")
|
||||
|
||||
|
||||
;; Do not require tramp at runtime. It is expensive to load. Instead,
|
||||
;; guard calls with (require 'tramp) and silence the byte compiler
|
||||
;; here.
|
||||
@@ -328,10 +330,12 @@ command conforms to VISIBLY."
|
||||
(defun ess-tracebug-send-region (process start end &optional visibly message type)
|
||||
"Send region to process adding source references as specified
|
||||
by `ess-inject-source' variable."
|
||||
(ess-eval-region--normalise-region start end)
|
||||
;; Disable evaluation env if we're sending a roxy region. This is
|
||||
;; not the ideal place to do this.
|
||||
(let* ((ess-r-evaluation-env (unless (ess-roxy--region-p start end)
|
||||
(let* ((se (ess-eval-region--normalise-region start end))
|
||||
(start (car se))
|
||||
(end (cdr se))
|
||||
(ess-r-evaluation-env (unless (ess-roxy--region-p start end)
|
||||
(ess-r-get-evaluation-env)))
|
||||
(inject-p (cond ((eq type 'function)
|
||||
ess-inject-source)
|
||||
@@ -542,13 +546,13 @@ can use `ess--busy-slash', `ess--busy-B',`ess--busy-stars',
|
||||
|
||||
(defcustom inferior-ess-replace-long+ t
|
||||
"Determines if ESS replaces long + sequences in output.
|
||||
If 'strip, remove all such instances. Otherwise, if non-nil, '+
|
||||
If \\='strip, remove all such instances. Otherwise, if non-nil, `+
|
||||
+ + + ' containing 3 or more + is replaced by
|
||||
`ess-long+replacement'.
|
||||
This variable can be process-local but not buffer-local."
|
||||
:group 'ess-tracebug
|
||||
:type '(choice (const nil :tag "No replacement")
|
||||
(const 'strip :tag "Replace all")
|
||||
(const strip :tag "Replace all")
|
||||
(const t :tag "Replace 3 or more +")))
|
||||
|
||||
(defvar ess-long+replacement ". + "
|
||||
@@ -648,7 +652,7 @@ Pop up a compilation/grep/occur like buffer. Usual global key
|
||||
bindings are available (\\[next-error] and \\[previous-error])
|
||||
for `next-error' and `previous-error' respectively.
|
||||
|
||||
You can bind 'no-select' versions of this commands:
|
||||
You can bind `no-select' versions of this commands:
|
||||
\(define-key compilation-minor-mode-map [(?n)] #'next-error-no-select)
|
||||
\(define-key compilation-minor-mode-map [(?p)] #'previous-error-no-select)"
|
||||
(interactive)
|
||||
@@ -722,7 +726,7 @@ This is the value of `next-error-function' in iESS buffers."
|
||||
(at-error t)
|
||||
(msg
|
||||
(condition-case nil
|
||||
(compilation-next-error n nil beg-pos)
|
||||
(compilation-next-error n nil beg-pos)
|
||||
(error
|
||||
(when pbuff-p
|
||||
(ess--tb-next-error-goto-process-marker))
|
||||
@@ -775,12 +779,12 @@ This is the value of `next-error-function' in iESS buffers."
|
||||
'(( "" "NONE" "NULL" )
|
||||
( " r" "RECOVER" "utils::recover")
|
||||
( " t" "TRACEBACK" "base::traceback"))
|
||||
"Alist of 'on-error' actions.
|
||||
"Alist of `on-error' actions.
|
||||
Toggled with `ess-debug-toggle-error-action'. Each element must
|
||||
have the form (DISP SYMB ACTION) where DISP is the string to be
|
||||
displayed in the mode line when the action is in place. SYMB is
|
||||
the symbolic name of an action. ACTION is the string giving the
|
||||
actual expression to be assigned to 'error' user option. See R's
|
||||
actual expression to be assigned to `error' user option. See R's
|
||||
help ?options for more details."
|
||||
:type '(alist :key-type string
|
||||
:value-type (group string string))
|
||||
@@ -830,7 +834,7 @@ In no-windowed Emacs an `overlay-arrow' is displayed at this position.")
|
||||
|
||||
(defcustom ess-debug-blink-interval .2
|
||||
"Time in seconds to blink the background of the debug line.
|
||||
Currently two events are defined 'ref-not-found' and 'same-ref'.
|
||||
Currently two events are defined `ref-not-found' and `same-ref'.
|
||||
Blinking colors for these events can be customized by
|
||||
corresponding faces."
|
||||
:group 'ess-debug
|
||||
@@ -912,7 +916,7 @@ The SPEC should be one of the components of
|
||||
(error "Unknown action"))))
|
||||
|
||||
(defun ess-debug-toggle-error-action ()
|
||||
"Toggle the 'on-error' action.
|
||||
"Toggle the `on-error' action.
|
||||
The action list is in `ess-debug-error-action-alist'."
|
||||
(interactive)
|
||||
(ess-force-buffer-current)
|
||||
@@ -947,7 +951,8 @@ The action list is in `ess-debug-error-action-alist'."
|
||||
(move-marker ess--dbg-current-debug-position (point-at-bol)))
|
||||
|
||||
(defun ess--dbg-deactivate-overlays ()
|
||||
"Deletes markers and overlays. Overlay arrow remains to indicate the last debug position."
|
||||
"Delete debugger markers and overlays.
|
||||
Overlay arrow remains to indicate the last debug position."
|
||||
(delete-overlay ess--dbg-current-debug-overlay)
|
||||
(set-marker ess--dbg-current-debug-position nil))
|
||||
|
||||
@@ -1531,7 +1536,7 @@ the output into *ess.dbg* buffer."
|
||||
:keymap ess-debug-minor-mode-map)
|
||||
|
||||
(defun ess--dbg-goto-last-ref-and-mark (dbuff &optional other-window)
|
||||
"Open the most recent debug reference, and set all the necessary marks and overlays.
|
||||
"Open the most recent debug reference and set the necessary marks and overlays.
|
||||
It's called from `inferior-ess-tracebug-output-filter'. DBUFF
|
||||
must be the *ess.dbg* buffer associated with the process. If
|
||||
OTHER-WINDOW is non nil, attempt to open the location in a
|
||||
@@ -1630,59 +1635,65 @@ nil, or TB-INDEX is not found return nil."
|
||||
(org-babel-tangle-jump-to-org))
|
||||
(list (point-marker) (copy-marker (point-at-eol))))))))))
|
||||
|
||||
(defvar ess-r-package-library-paths)
|
||||
(defun ess--dbg-find-buffer (filename)
|
||||
"Find a buffer for file FILENAME.
|
||||
If FILENAME is not found at all, ask the user where to find it if
|
||||
`ess--dbg-ask-for-file' is non-nil. Search the directories in
|
||||
`ess-tracebug-search-path'."
|
||||
`ess-tracebug-search-path' and `ess-r-package-library-paths'."
|
||||
(let ((dirs (append
|
||||
(ess-r-package-source-dirs)
|
||||
(cl-loop for d in ess-tracebug-search-path
|
||||
ess-r-package-library-paths
|
||||
(cl-loop for d in (append ess-tracebug-search-path)
|
||||
append (ess-r-package--all-source-dirs d))))
|
||||
(filematch (format "%s\\'" filename))
|
||||
buffer name)
|
||||
(setq dirs (cons default-directory dirs)) ;; TODO: should be R working dir
|
||||
;; 1. search already open buffers for match (associated file might not even exist yet)
|
||||
(cl-dolist (bf (buffer-list))
|
||||
(with-current-buffer bf
|
||||
(when (and buffer-file-name
|
||||
(string-match (format "%s\\'" filename) buffer-file-name))
|
||||
(setq buffer bf)
|
||||
(cl-return))))
|
||||
;; 2. The file name is absolute. Use its explicit directory as
|
||||
(setq dirs (delq nil (cons (with-ess-process-buffer t default-directory) dirs)))
|
||||
;; 1. The file name is absolute. Use its explicit directory as
|
||||
;; the first in the search path, and strip it from FILENAME.
|
||||
(when (and (null buffer)
|
||||
(file-name-absolute-p filename))
|
||||
(setq filename (abbreviate-file-name (expand-file-name filename))
|
||||
dirs (cons (file-name-directory filename) dirs)
|
||||
filename (file-name-nondirectory filename)))
|
||||
;; 3. Now search the path.
|
||||
(while (and (null buffer) dirs)
|
||||
(let ((thisdir (pop dirs)))
|
||||
(setq name (expand-file-name filename thisdir)
|
||||
buffer (and (file-exists-p name)
|
||||
(find-file-noselect name)))))
|
||||
;; 4. Ask for file if not found (tothink: maybe remove this part?)
|
||||
(if (and (null buffer)
|
||||
ess-debug-ask-for-file)
|
||||
(save-excursion ;This save-excursion is probably not right.
|
||||
(let* ((pop-up-windows t)
|
||||
(name (read-file-name
|
||||
(format "Find next line in (default %s): " filename)
|
||||
nil filename t nil))
|
||||
(origname name))
|
||||
(cond
|
||||
((not (file-exists-p name))
|
||||
(message "Cannot find file `%s'" name)
|
||||
(ding) (sit-for 2))
|
||||
((and (file-directory-p name)
|
||||
(not (file-exists-p
|
||||
(setq name (expand-file-name filename name)))))
|
||||
(message "No `%s' in directory %s" filename origname)
|
||||
(ding) (sit-for 2))
|
||||
(t
|
||||
(setq buffer (find-file-noselect name)))))))
|
||||
;; nil if not found
|
||||
buffer))
|
||||
(or
|
||||
;; 2. Search the path.
|
||||
(while (and (null buffer) dirs)
|
||||
(let ((thisdir (pop dirs)))
|
||||
(setq name (expand-file-name filename thisdir)
|
||||
buffer (and (file-exists-p name)
|
||||
(find-file-noselect name)))))
|
||||
buffer
|
||||
|
||||
;; 3. search already open buffers for match (associated file might not even exist yet)
|
||||
(cl-dolist (bf (buffer-list))
|
||||
(with-current-buffer bf
|
||||
(when (and buffer-file-name
|
||||
(string-match filematch buffer-file-name))
|
||||
(setq buffer bf)
|
||||
(cl-return))))
|
||||
buffer
|
||||
|
||||
;; 4. Ask for file if not found (tothink: maybe remove this part?)
|
||||
(when ess-debug-ask-for-file
|
||||
(save-excursion ;This save-excursion is probably not right.
|
||||
(let* ((pop-up-windows t)
|
||||
(name (read-file-name
|
||||
(format "Find next line in (default %s): " filename)
|
||||
nil filename t nil))
|
||||
(origname name))
|
||||
(cond
|
||||
((not (file-exists-p name))
|
||||
(message "Cannot find file `%s'" name)
|
||||
(ding) (sit-for 2))
|
||||
((and (file-directory-p name)
|
||||
(not (file-exists-p
|
||||
(setq name (expand-file-name filename name)))))
|
||||
(message "No `%s' in directory %s" filename origname)
|
||||
(ding) (sit-for 2))
|
||||
(t
|
||||
(setq buffer (find-file-noselect name)))))))
|
||||
buffer)))
|
||||
|
||||
(defun ess--dbg-get-next-ref (n &optional pt BOUND REG nF nL nC)
|
||||
"Move point to the next reference in the *ess.dbg* buffer.
|
||||
@@ -1694,9 +1705,9 @@ to move forwards (or backwards, if negative). Optional arg PT,
|
||||
if non-nil, specifies the value of point to start looking for the
|
||||
next message, default to (point). BOUND is the limiting position
|
||||
of the search. REG is the regular expression to search with. nF
|
||||
- sub-expression of REG giving the 'file'; defaults to 1. nL -
|
||||
giving the 'line'; defaults to 2. nC - sub-expr giving the
|
||||
'column'; defaults to 3."
|
||||
- sub-expression of REG giving the `file'; defaults to 1. nL -
|
||||
giving the `line'; defaults to 2. nC - sub-expr giving the
|
||||
`column'; defaults to 3."
|
||||
(unless ess--dbg-buf-p
|
||||
(error "Not in *ess.dbg* buffer"))
|
||||
(setq nF (or nF 1)
|
||||
@@ -1765,7 +1776,7 @@ If supplied, EV must be a proper key event or a string representing the digit."
|
||||
|
||||
(defun ess-debug-command-next ()
|
||||
"Step next in debug mode.
|
||||
Equivalent to 'n' at the R prompt."
|
||||
Equivalent to `n' at the R prompt."
|
||||
(interactive)
|
||||
(ess-force-buffer-current)
|
||||
(unless (ess--dbg-is-active-p)
|
||||
@@ -1879,7 +1890,7 @@ ARGS are ignored to allow using this function in process hooks."
|
||||
(((class color) (background dark) (min-colors 88)) (:foreground "deep sky blue"))
|
||||
(((background light) (min-colors 8)) (:foreground "blue"))
|
||||
(((background dark) (min-colors 8)) (:foreground "cyan")))
|
||||
"Face used to highlight 'browser' breakpoints."
|
||||
"Face used to highlight `browser' breakpoints."
|
||||
:group 'ess-debug)
|
||||
|
||||
(defface ess-bp-fringe-recover-face
|
||||
@@ -1887,7 +1898,7 @@ ARGS are ignored to allow using this function in process hooks."
|
||||
(((class color) (background dark) (min-colors 88)) (:foreground "magenta"))
|
||||
(((background light) (min-colors 8)) (:foreground "magenta"))
|
||||
(((background dark) (min-colors 8)) (:foreground "magenta")))
|
||||
"Face used to highlight 'recover' breakpoints fringe."
|
||||
"Face used to highlight `recover' breakpoints fringe."
|
||||
:group 'ess-debug)
|
||||
|
||||
(defun ess--bp-pipe-block-p ()
|
||||
@@ -1898,9 +1909,18 @@ ARGS are ignored to allow using this function in process hooks."
|
||||
(end-of-line)
|
||||
(looking-back "%>%[ \t]*" (point-at-bol)))))
|
||||
|
||||
(defun ess--bp-pipe-native-block-p ()
|
||||
(save-excursion
|
||||
(let ((inhibit-point-motion-hooks t)
|
||||
(inhibit-field-text-motion t))
|
||||
(forward-line -1)
|
||||
(end-of-line)
|
||||
(looking-back "|>[ \t]*" (point-at-bol)))))
|
||||
|
||||
(defvar ess--bp-identifier 1)
|
||||
(defcustom ess-bp-type-spec-alist
|
||||
'((pipe ".ess_pipe_browser() %%>%%" "B %>%\n" filled-square ess-bp-fringe-browser-face ess--bp-pipe-block-p)
|
||||
(pipe-native ".ess_pipe_browser() |>" "B |>\n" filled-square ess-bp-fringe-browser-face ess--bp-pipe-native-block-p)
|
||||
(browser "browser(expr=is.null(.ESSBP.[[%s]]));" "B>\n" filled-square ess-bp-fringe-browser-face)
|
||||
(recover "recover()" "R>\n" filled-square ess-bp-fringe-recover-face))
|
||||
"List of lists of breakpoint types.
|
||||
@@ -2465,8 +2485,10 @@ string giving the actual R expression."
|
||||
wal)))
|
||||
|
||||
(defun ess-watch--parse-assoc (al)
|
||||
"Return a string of the form 'assign(\".ess_watch_expressions\", list(a = parse(expr_a), b= parse(expr_b)), envir = .GlobalEnv)'
|
||||
ready to be send to R process. AL is an association list as return by `ess-watch--make-alist'"
|
||||
"Return a string command ready to be passed to R process.
|
||||
The command is of the form `assign(\".ess_watch_expressions\",
|
||||
list(a = parse(expr_a), b= parse(expr_b)), envir = .GlobalEnv)'.
|
||||
AL is an association list as return by `ess-watch--make-alist'"
|
||||
(concat ".ess_watch_assign_expressions(list("
|
||||
(mapconcat (lambda (el)
|
||||
(if (> (length (cadr el) ) 0)
|
||||
@@ -2572,7 +2594,7 @@ Optional N if supplied gives the number of backward steps."
|
||||
(ess-watch-refresh-buffer-visibly (current-buffer))))
|
||||
|
||||
(defun ess-watch-add ()
|
||||
"Ask for new R expression and name and append it to the end of the list of watch expressions."
|
||||
"Ask for new R expression and append to the current list of watch expressions."
|
||||
(interactive)
|
||||
(let (nr expr name)
|
||||
(goto-char (point-max))
|
||||
|
||||
Reference in New Issue
Block a user