Commit Graph

24 Commits

Author SHA1 Message Date
3a38fc633c Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
4f27d8e774 Fix #3070: project scratch buffers not persistent 2020-05-08 15:08:25 -04:00
cb8b66dd36 Remove old persisted scratch buffer file
This was for backward compatibility with the old format. Removing this
now after two months being deprecated.
2020-05-08 14:44:48 -04:00
79e5a27fab Prefix arg = don't restore last scratch buffer 2020-03-03 12:44:33 -05:00
e54ebcbff5 Fix #2607: void-variable doom-scratch-initial-major-mode error
And fix "selected deleted buffer" error caused by aggressive
window-configuration-change-hook function.
2020-02-26 09:46:50 -05:00
9fa76836c1 Persist scratch buffer point, mode & contents
Also renames doom-scratch-buffer-major-mode ->
doom-scratch-initial-major-mode, since it only affects the initial
buffer now.

This was designed to be backwards compatible; you won't lose your
scratch buffers from this update. Though I may remove the old format in
3.1.
2020-02-25 20:30:23 -05:00
da3e24e686 Preserve cursor position for scratch buffer
Not across restarts, but across toggles of the scratch popup.
2020-02-25 18:11:13 -05:00
4a5cf04761 General refactors & appease byte-compiler 2020-02-02 02:05:20 -05:00
adc8cba14b Revise docstrings & minor reformatting 2019-12-26 01:41:44 -05:00
374940b959 Persist scratch buffers more proactively
Prior to this change, scratch buffers were saved only when Emacs is
killed. In cases where Emacs doesn't die properly, you'd lose your
scratch contents. Now, they are persisted as soon as you close them.
2019-08-15 01:07:45 -04:00
7ded14f548 Refactor scratch buffer init 2019-08-15 01:02:00 -04:00
c7ce21af70 Fix prefix arg for doom/switch-to-scratch-buffer
Also use clearer name for prefix arg var in
doom/open-project-scratch-buffer.
2019-07-22 02:30:41 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
8f9056906d Rethink scratch buffer keybinds & commands
For non-evil users:

<leader> x    doom/open-scratch-buffer
<leader> X    doom/switch-to-scratch-buffer
<leader> p s  doom/open-project-scratch-buffer
<leader> p S  doom/switch-to-project-scratch-buffer

For evil users:

<leader> x    doom/open-scratch-buffer
<leader> b s  doom/open-scratch-buffer
<leader> b S  doom/switch-to-scratch-buffer
<leader> p s  doom/open-project-scratch-buffer
<leader> p S  doom/switch-to-project-scratch-buffer
2019-05-20 21:09:12 -04:00
40d2d4d222 Minor tweaks & byte-compiler offerings 2019-05-15 20:53:11 -04:00
eb22177cea Suppress kill-emacs-hook in noninteractive Doom 2019-04-24 18:16:06 -04:00
123f7174ed Revise docstrings for scratch buffer commands 2019-04-19 20:50:53 -04:00
6cd30c926b Persist scratch buffer across sessions
- Adds doom/open-project-scratch-buffer (persistent project scratch
  buffers)
- Prefix arg = open scratch buffer in current window, for both
  doom/open-scratch-buffer and doom/open-project-scratch-buffer.
- Rename doom/delete-scratch-files ->
  doom/delete-persistent-scratch-file
- Remove doom-scratch-buffer-display-fn
- Rename doom-scratch-files-dir -> doom-scratch-dir
- Add SPC p s keybind to open project scratch buffer
2019-04-17 11:15:56 -04:00
7d3ffdff06 Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
f44a227e74 Refactor scratch buffer; add doom-scratch-buffer-major-mode option #490
Also set the default scratch buffer major mode to fundamental-mode
2018-03-28 18:39:46 -04:00
7afc62fb1d Rewrite scratch buffer commands
+ No longer open persistent scratch buffers by default. Supply the
  universal argument to do that.

  SPC x = open throw-away scratch buffer
  SPC u SPC x = open persistent scratch buffer (prompted for file)

+ Added doom/delete-scratch-files
2018-03-07 21:15:15 -05:00
bbb969fa59 Combine doom/open-scratch-buffer & doom/open-project-scratch-buffer
These two are now doom/open-scratch-buffer. If you're in a project,
a (persistent) scratch buffer is opened. Otherwise, a non-persistent,
transient scratch buffer is opened.

If ARG (universal argument) is non-nil, then use the current window
instead of a new window (or popup, if feature/popup is enabled).

Also, the ex command :x[!] is improved. The BANG = open in current
window.
2018-02-02 20:47:33 -05:00
91357a3e5d 💥 Replace core-popup with new feature/popup module
This is a breaking change! Update your :popup settings. Old ones will
throw errors!

Doom's new popup management system casts off its shackles (hur hur) and
replaces them with the monster that is `display-buffer-alist`, and
window parameters.

However, this is highly experimental! Expect edge cases.  Particularly
with org-mode and magit (or anything that does its own window
management).

Relevant to #261, #263, #325
2018-01-06 02:17:43 -05:00
04a3db3d2b Move scratch commands to core/autoload/scratch.el 2017-09-27 01:21:10 +02:00