added stuff
This commit is contained in:
parent
2cc8864144
commit
e0f0e37e0a
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -0,0 +1,39 @@
|
|||
;;; dashboard-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (directory-file-name
|
||||
(or (file-name-directory #$) (car load-path))))
|
||||
|
||||
|
||||
;;;### (autoloads nil "dashboard" "dashboard.el" (0 0 0 0))
|
||||
;;; Generated autoloads from dashboard.el
|
||||
|
||||
(autoload 'dashboard-setup-startup-hook "dashboard" "\
|
||||
Setup post initialization hooks.
|
||||
If a command line argument is provided,
|
||||
assume a filename and skip displaying Dashboard." nil nil)
|
||||
|
||||
(register-definition-prefixes "dashboard" '("dashboard-"))
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "dashboard-widgets" "dashboard-widgets.el"
|
||||
;;;;;; (0 0 0 0))
|
||||
;;; Generated autoloads from dashboard-widgets.el
|
||||
|
||||
(register-definition-prefixes "dashboard-widgets" '("dashboard-" "org-" "recentf-list"))
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil nil ("dashboard-pkg.el") (0 0 0 0))
|
||||
|
||||
;;;***
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; coding: utf-8
|
||||
;; End:
|
||||
;;; dashboard-autoloads.el ends here
|
|
@ -0,0 +1,13 @@
|
|||
(define-package "dashboard" "20210325.757" "A startup screen extracted from Spacemacs"
|
||||
'((emacs "25.3")
|
||||
(page-break-lines "0.11"))
|
||||
:commit "00f1dc84d3fbaf439d23645aa531eee59e28f688" :authors
|
||||
'(("Rakan Al-Hneiti"))
|
||||
:maintainer
|
||||
'("Rakan Al-Hneiti")
|
||||
:keywords
|
||||
'("startup" "screen" "tools" "dashboard")
|
||||
:url "https://github.com/emacs-dashboard/emacs-dashboard")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -0,0 +1,277 @@
|
|||
;;; dashboard.el --- A startup screen extracted from Spacemacs -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (c) 2016-2020 Rakan Al-Hneiti <rakan.alhneiti@gmail.com>
|
||||
;; Copyright (c) 2019-2021 Jesús Martínez <jesusmartinez93@gmail.com>
|
||||
;; Copyright (c) 2020-2021 Shen, Jen-Chieh <jcs090218@gmail.com>
|
||||
;;
|
||||
;; Author: Rakan Al-Hneiti
|
||||
;; URL: https://github.com/emacs-dashboard/emacs-dashboard
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
;;
|
||||
;; Created: October 05, 2016
|
||||
;; Package-Version: 1.8.0-SNAPSHOT
|
||||
;; Keywords: startup, screen, tools, dashboard
|
||||
;; Package-Requires: ((emacs "25.3") (page-break-lines "0.11"))
|
||||
;;; Commentary:
|
||||
|
||||
;; An extensible Emacs dashboard, with sections for
|
||||
;; bookmarks, projects (projectile or project.el), org-agenda and more.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'seq)
|
||||
(require 'recentf)
|
||||
|
||||
(require 'dashboard-widgets)
|
||||
|
||||
;; Custom splash screen
|
||||
(defvar dashboard-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "C-p") 'dashboard-previous-line)
|
||||
(define-key map (kbd "C-n") 'dashboard-next-line)
|
||||
(define-key map (kbd "<up>") 'dashboard-previous-line)
|
||||
(define-key map (kbd "<down>") 'dashboard-next-line)
|
||||
(define-key map (kbd "k") 'dashboard-previous-line)
|
||||
(define-key map (kbd "j") 'dashboard-next-line)
|
||||
(define-key map [tab] 'widget-forward)
|
||||
(define-key map (kbd "C-i") 'widget-forward)
|
||||
(define-key map [backtab] 'widget-backward)
|
||||
(define-key map (kbd "RET") 'dashboard-return)
|
||||
(define-key map [mouse-1] 'dashboard-mouse-1)
|
||||
(define-key map (kbd "g") #'dashboard-refresh-buffer)
|
||||
(define-key map (kbd "}") #'dashboard-next-section)
|
||||
(define-key map (kbd "{") #'dashboard-previous-section)
|
||||
map)
|
||||
"Keymap for dashboard mode.")
|
||||
|
||||
(defcustom dashboard-after-initialize-hook nil
|
||||
"Hook that is run after dashboard buffer is initialized."
|
||||
:group 'dashboard
|
||||
:type 'hook)
|
||||
|
||||
(define-derived-mode dashboard-mode special-mode "Dashboard"
|
||||
"Dashboard major mode for startup screen.
|
||||
\\<dashboard-mode-map>
|
||||
"
|
||||
:group 'dashboard
|
||||
:syntax-table nil
|
||||
:abbrev-table nil
|
||||
(buffer-disable-undo)
|
||||
(whitespace-mode -1)
|
||||
(linum-mode -1)
|
||||
(when (>= emacs-major-version 26)
|
||||
(display-line-numbers-mode -1))
|
||||
(page-break-lines-mode 1)
|
||||
(setq inhibit-startup-screen t
|
||||
buffer-read-only t
|
||||
truncate-lines t))
|
||||
|
||||
(defgroup dashboard nil
|
||||
"Extensible startup screen."
|
||||
:group 'applications)
|
||||
|
||||
(defcustom dashboard-center-content nil
|
||||
"Whether to center content within the window."
|
||||
:type 'boolean
|
||||
:group 'dashboard)
|
||||
|
||||
(defconst dashboard-buffer-name "*dashboard*"
|
||||
"Dashboard's buffer name.")
|
||||
|
||||
(defvar dashboard--section-starts nil
|
||||
"List of section starting positions.")
|
||||
|
||||
(defvar dashboard-force-refresh nil
|
||||
"If non-nil, force refresh dashboard buffer.")
|
||||
|
||||
(defun dashboard-previous-section ()
|
||||
"Navigate back to previous section."
|
||||
(interactive)
|
||||
(let ((current-section-start nil)
|
||||
(current-position (point))
|
||||
(previous-section-start nil))
|
||||
(dolist (elt dashboard--section-starts)
|
||||
(when (and current-section-start
|
||||
(not previous-section-start))
|
||||
(setq previous-section-start elt))
|
||||
(when (and (not current-section-start)
|
||||
(< elt current-position))
|
||||
(setq current-section-start elt)))
|
||||
(goto-char (if (eq current-position current-section-start)
|
||||
previous-section-start
|
||||
current-section-start))))
|
||||
|
||||
(defun dashboard-next-section ()
|
||||
"Navigate forward to next section."
|
||||
(interactive)
|
||||
(let ((current-position (point))
|
||||
(next-section-start nil)
|
||||
(section-starts (reverse dashboard--section-starts)))
|
||||
(dolist (elt section-starts)
|
||||
(when (and (not next-section-start)
|
||||
(> elt current-position))
|
||||
(setq next-section-start elt)))
|
||||
(when next-section-start
|
||||
(goto-char next-section-start))))
|
||||
|
||||
(defun dashboard-previous-line (arg)
|
||||
"Move point up and position it at that line’s item.
|
||||
Optional prefix ARG says how many lines to move; default is one line."
|
||||
(interactive "^p")
|
||||
(dashboard-next-line (- arg)))
|
||||
|
||||
(defun dashboard-next-line (arg)
|
||||
"Move point down and position it at that line’s item.
|
||||
Optional prefix ARG says how many lines to move; default is one line."
|
||||
;; code heavily inspired by `dired-next-line'
|
||||
(interactive "^p")
|
||||
(let ((line-move-visual nil)
|
||||
(goal-column nil))
|
||||
(line-move arg t))
|
||||
;; We never want to move point into an invisible line. Dashboard doesn’t
|
||||
;; use invisible text currently but when it does we’re ready!
|
||||
(while (and (invisible-p (point))
|
||||
(not (if (and arg (< arg 0)) (bobp) (eobp))))
|
||||
(forward-char (if (and arg (< arg 0)) -1 1)))
|
||||
(beginning-of-line-text))
|
||||
|
||||
(defun dashboard-return ()
|
||||
"Hit return key in dashboard buffer."
|
||||
(interactive)
|
||||
(let ((start-ln (line-number-at-pos))
|
||||
(fd-cnt 0)
|
||||
(diff-line nil)
|
||||
(entry-pt nil))
|
||||
(save-excursion
|
||||
(while (and (not diff-line)
|
||||
(not (= (point) (point-min)))
|
||||
(not (get-char-property (point) 'button))
|
||||
(not (= (point) (point-max))))
|
||||
(forward-char 1)
|
||||
(setq fd-cnt (1+ fd-cnt))
|
||||
(unless (= start-ln (line-number-at-pos))
|
||||
(setq diff-line t)))
|
||||
(unless (= (point) (point-max))
|
||||
(setq entry-pt (point))))
|
||||
(when (= fd-cnt 1)
|
||||
(setq entry-pt (1- (point))))
|
||||
(if entry-pt
|
||||
(widget-button-press entry-pt)
|
||||
(call-interactively #'widget-button-press))))
|
||||
|
||||
(defun dashboard-mouse-1 ()
|
||||
"Key for keymap `mouse-1'."
|
||||
(interactive)
|
||||
(let ((old-track-mouse track-mouse))
|
||||
(when (call-interactively #'widget-button-click)
|
||||
(setq track-mouse old-track-mouse))))
|
||||
|
||||
(defun dashboard-maximum-section-length ()
|
||||
"For the just-inserted section, calculate the length of the longest line."
|
||||
(let ((max-line-length 0))
|
||||
(save-excursion
|
||||
(dashboard-previous-section)
|
||||
(while (not (eobp))
|
||||
(setq max-line-length
|
||||
(max max-line-length
|
||||
(- (line-end-position) (line-beginning-position))))
|
||||
(forward-line 1)))
|
||||
max-line-length))
|
||||
|
||||
(defun dashboard-insert-startupify-lists ()
|
||||
"Insert the list of widgets into the buffer."
|
||||
(interactive)
|
||||
(let ((buffer-exists (buffer-live-p (get-buffer dashboard-buffer-name)))
|
||||
(recentf-is-on (recentf-enabled-p))
|
||||
(origial-recentf-list recentf-list)
|
||||
(dashboard-num-recents (or (cdr (assoc 'recents dashboard-items)) 0))
|
||||
(max-line-length 0))
|
||||
;; disable recentf mode,
|
||||
;; so we don't flood the recent files list with org mode files
|
||||
;; do this by making a copy of the part of the list we'll use
|
||||
;; let dashboard widgets change that
|
||||
;; then restore the orginal list afterwards
|
||||
;; (this avoids many saves/loads that would result from
|
||||
;; disabling/enabling recentf-mode)
|
||||
(when recentf-is-on
|
||||
(setq recentf-list (seq-take recentf-list dashboard-num-recents)))
|
||||
(when (or dashboard-force-refresh
|
||||
(not (eq dashboard-buffer-last-width (window-width)))
|
||||
(not buffer-exists))
|
||||
(setq dashboard-banner-length (window-width)
|
||||
dashboard-buffer-last-width dashboard-banner-length)
|
||||
(with-current-buffer (get-buffer-create dashboard-buffer-name)
|
||||
(let ((buffer-read-only nil))
|
||||
(erase-buffer)
|
||||
(dashboard-insert-banner)
|
||||
(dashboard-insert-page-break)
|
||||
(setq dashboard--section-starts nil)
|
||||
(mapc (lambda (els)
|
||||
(let* ((el (or (car-safe els) els))
|
||||
(list-size
|
||||
(or (cdr-safe els)
|
||||
dashboard-items-default-length))
|
||||
(item-generator
|
||||
(cdr-safe (assoc el dashboard-item-generators))))
|
||||
(add-to-list 'dashboard--section-starts (point))
|
||||
(funcall item-generator list-size)
|
||||
(when recentf-is-on
|
||||
(setq recentf-list origial-recentf-list))
|
||||
(setq max-line-length
|
||||
(max max-line-length (dashboard-maximum-section-length)))
|
||||
(dashboard-insert-page-break)))
|
||||
dashboard-items)
|
||||
(when dashboard-center-content
|
||||
(when dashboard--section-starts
|
||||
(goto-char (car (last dashboard--section-starts))))
|
||||
(let ((margin (floor (/ (max (- (window-width) max-line-length) 0) 2))))
|
||||
(while (not (eobp))
|
||||
(unless (string-suffix-p (thing-at-point 'line) dashboard-page-separator)
|
||||
(insert (make-string margin ?\ )))
|
||||
(forward-line 1))))
|
||||
(dashboard-insert-footer))
|
||||
(goto-char (point-min))
|
||||
(dashboard-mode)))
|
||||
(when recentf-is-on
|
||||
(setq recentf-list origial-recentf-list))))
|
||||
|
||||
(add-hook 'window-setup-hook
|
||||
(lambda ()
|
||||
(add-hook 'window-size-change-functions 'dashboard-resize-on-hook)
|
||||
(dashboard-resize-on-hook)))
|
||||
|
||||
(defun dashboard-refresh-buffer ()
|
||||
"Refresh buffer."
|
||||
(interactive)
|
||||
(let ((dashboard-force-refresh t)) (dashboard-insert-startupify-lists))
|
||||
(switch-to-buffer dashboard-buffer-name))
|
||||
|
||||
(defun dashboard-resize-on-hook (&optional _)
|
||||
"Re-render dashboard on window size change."
|
||||
(let ((space-win (get-buffer-window dashboard-buffer-name))
|
||||
(frame-win (frame-selected-window)))
|
||||
(when (and space-win
|
||||
(not (window-minibuffer-p frame-win)))
|
||||
(with-selected-window space-win
|
||||
(dashboard-insert-startupify-lists)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun dashboard-setup-startup-hook ()
|
||||
"Setup post initialization hooks.
|
||||
If a command line argument is provided,
|
||||
assume a filename and skip displaying Dashboard."
|
||||
(when (< (length command-line-args) 2)
|
||||
(add-hook 'after-init-hook (lambda ()
|
||||
;; Display useful lists of items
|
||||
(dashboard-insert-startupify-lists)))
|
||||
(add-hook 'emacs-startup-hook (lambda ()
|
||||
(switch-to-buffer dashboard-buffer-name)
|
||||
(goto-char (point-min))
|
||||
(redisplay)
|
||||
(run-hooks 'dashboard-after-initialize-hook)))))
|
||||
|
||||
(provide 'dashboard)
|
||||
;;; dashboard.el ends here
|
Binary file not shown.
|
@ -0,0 +1,73 @@
|
|||
;;; page-break-lines-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*-
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (directory-file-name
|
||||
(or (file-name-directory #$) (car load-path))))
|
||||
|
||||
|
||||
;;;### (autoloads nil "page-break-lines" "page-break-lines.el" (0
|
||||
;;;;;; 0 0 0))
|
||||
;;; Generated autoloads from page-break-lines.el
|
||||
|
||||
(autoload 'page-break-lines-mode "page-break-lines" "\
|
||||
Toggle Page Break Lines mode.
|
||||
|
||||
If called interactively, toggle `Page-Break-Lines mode'. If the
|
||||
prefix argument is positive, enable the mode, and if it is zero
|
||||
or negative, disable the mode.
|
||||
|
||||
If called from Lisp, toggle the mode if ARG is `toggle'. Enable
|
||||
the mode if ARG is nil, omitted, or is a positive number.
|
||||
Disable the mode if ARG is a negative number.
|
||||
|
||||
The mode's hook is called both when the mode is enabled and when
|
||||
it is disabled.
|
||||
|
||||
In Page Break mode, page breaks (^L characters) are displayed as a
|
||||
horizontal line of `page-break-lines-char' characters.
|
||||
|
||||
\(fn &optional ARG)" t nil)
|
||||
|
||||
(autoload 'page-break-lines-mode-maybe "page-break-lines" "\
|
||||
Enable `page-break-lines-mode' in the current buffer if desired.
|
||||
When `major-mode' is listed in `page-break-lines-modes', then
|
||||
`page-break-lines-mode' will be enabled." nil nil)
|
||||
|
||||
(put 'global-page-break-lines-mode 'globalized-minor-mode t)
|
||||
|
||||
(defvar global-page-break-lines-mode nil "\
|
||||
Non-nil if Global Page-Break-Lines mode is enabled.
|
||||
See the `global-page-break-lines-mode' command
|
||||
for a description of this minor mode.
|
||||
Setting this variable directly does not take effect;
|
||||
either customize it (see the info node `Easy Customization')
|
||||
or call the function `global-page-break-lines-mode'.")
|
||||
|
||||
(custom-autoload 'global-page-break-lines-mode "page-break-lines" nil)
|
||||
|
||||
(autoload 'global-page-break-lines-mode "page-break-lines" "\
|
||||
Toggle Page-Break-Lines mode in all buffers.
|
||||
With prefix ARG, enable Global Page-Break-Lines mode if ARG is
|
||||
positive; otherwise, disable it. If called from Lisp, enable the mode if
|
||||
ARG is omitted or nil.
|
||||
|
||||
Page-Break-Lines mode is enabled in all buffers where
|
||||
`page-break-lines-mode-maybe' would do it.
|
||||
|
||||
See `page-break-lines-mode' for more information on Page-Break-Lines
|
||||
mode.
|
||||
|
||||
\(fn &optional ARG)" t nil)
|
||||
|
||||
(register-definition-prefixes "page-break-lines" '("page-break-lines-"))
|
||||
|
||||
;;;***
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; coding: utf-8
|
||||
;; End:
|
||||
;;; page-break-lines-autoloads.el ends here
|
|
@ -0,0 +1,2 @@
|
|||
;;; Generated package description from page-break-lines.el -*- no-byte-compile: t -*-
|
||||
(define-package "page-break-lines" "20210104.2224" "Display ^L page breaks as tidy horizontal lines" '((emacs "24.4")) :commit "3b8549cd414d4d7ee0168ab9917124133566d3db" :authors '(("Steve Purcell" . "steve@sanityinc.com")) :maintainer '("Steve Purcell" . "steve@sanityinc.com") :keywords '("convenience" "faces") :url "https://github.com/purcell/page-break-lines")
|
|
@ -0,0 +1,179 @@
|
|||
;;; page-break-lines.el --- Display ^L page breaks as tidy horizontal lines -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012-2015 Steve Purcell
|
||||
|
||||
;; Author: Steve Purcell <steve@sanityinc.com>
|
||||
;; URL: https://github.com/purcell/page-break-lines
|
||||
;; Package-Commit: 3b8549cd414d4d7ee0168ab9917124133566d3db
|
||||
;; Package-Version: 20210104.2224
|
||||
;; Package-X-Original-Version: 0
|
||||
;; Package-Requires: ((emacs "24.4"))
|
||||
;; Keywords: convenience, faces
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This library provides a global mode which displays form feed
|
||||
;; characters as horizontal rules.
|
||||
|
||||
;; Install from Melpa or Marmalade, or add to `load-path' and use
|
||||
;; (require 'page-break-lines).
|
||||
|
||||
;; Use `page-break-lines-mode' to enable the mode in specific buffers,
|
||||
;; or customize `page-break-lines-modes' and enable the mode globally with
|
||||
;; `global-page-break-lines-mode'.
|
||||
|
||||
;; Issues and limitations:
|
||||
|
||||
;; If `page-break-lines-char' is displayed at a different width to
|
||||
;; regular characters, the rule may be either too short or too long:
|
||||
;; rules may then wrap if `truncate-lines' is nil. On some systems,
|
||||
;; Emacs may erroneously choose a different font for the page break
|
||||
;; symbol, which choice can be overridden using code such as:
|
||||
|
||||
;; (set-fontset-font "fontset-default"
|
||||
;; (cons page-break-lines-char page-break-lines-char)
|
||||
;; (face-attribute 'default :family))
|
||||
|
||||
;; Use `describe-char' on a page break char to determine whether this
|
||||
;; is the case.
|
||||
|
||||
;; Additionally, the use of `text-scale-increase' or
|
||||
;; `text-scale-decrease' will cause the rule width to be incorrect,
|
||||
;; because the reported window width (in characters) will continue to
|
||||
;; be the width in the frame's default font, not the scaled font used to
|
||||
;; display the rule.
|
||||
|
||||
;; Adapted from code http://www.emacswiki.org/emacs/PageBreaks
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup page-break-lines nil
|
||||
"Display ugly ^L page breaks as tidy horizontal lines."
|
||||
:prefix "page-break-lines-"
|
||||
:group 'faces)
|
||||
|
||||
(defcustom page-break-lines-char ?─
|
||||
"Character used to render page break lines."
|
||||
:type 'character
|
||||
:group 'page-break-lines)
|
||||
|
||||
(defcustom page-break-lines-lighter " PgLn"
|
||||
"Mode-line indicator for `page-break-lines-mode'."
|
||||
:type '(choice (const :tag "No lighter" "") string)
|
||||
:group 'page-break-lines)
|
||||
|
||||
(defcustom page-break-lines-max-width nil
|
||||
"If non-nil, maximum width (in characters) of page break indicator.
|
||||
If nil, indicator will span the width of the frame."
|
||||
:type '(choice integer (const :tag "Full width" nil))
|
||||
:group 'page-break-lines)
|
||||
|
||||
(defcustom page-break-lines-modes
|
||||
'(emacs-lisp-mode lisp-mode scheme-mode compilation-mode outline-mode help-mode)
|
||||
"Modes in which to enable `page-break-lines-mode'."
|
||||
:type '(repeat symbol)
|
||||
:group 'page-break-lines)
|
||||
|
||||
(defface page-break-lines
|
||||
'((t :inherit font-lock-comment-face :bold nil :italic nil))
|
||||
"Face used to colorize page break lines.
|
||||
If using :bold or :italic, please ensure `page-break-lines-char'
|
||||
is available in that variant of your font, otherwise it may be
|
||||
displayed as a junk character."
|
||||
:group 'page-break-lines)
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode page-break-lines-mode
|
||||
"Toggle Page Break Lines mode.
|
||||
|
||||
In Page Break mode, page breaks (^L characters) are displayed as a
|
||||
horizontal line of `page-break-lines-char' characters."
|
||||
:lighter page-break-lines-lighter
|
||||
:group 'page-break-lines
|
||||
(page-break-lines--update-display-tables))
|
||||
|
||||
(dolist (hook '(window-configuration-change-hook
|
||||
window-size-change-functions
|
||||
after-setting-font-hook
|
||||
display-line-numbers-mode-hook))
|
||||
(add-hook hook 'page-break-lines--update-display-tables))
|
||||
|
||||
|
||||
|
||||
(defun page-break-lines--update-display-table (window)
|
||||
"Modify a display-table that displays page-breaks prettily.
|
||||
If the buffer inside WINDOW has `page-break-lines-mode' enabled,
|
||||
its display table will be modified as necessary."
|
||||
(with-current-buffer (window-buffer window)
|
||||
(with-selected-window window
|
||||
(if page-break-lines-mode
|
||||
(progn
|
||||
(unless buffer-display-table
|
||||
(setq buffer-display-table (make-display-table)))
|
||||
(let ((default-height (face-attribute 'default :height nil 'default)))
|
||||
(set-face-attribute 'page-break-lines nil :height default-height)
|
||||
(let* ((cwidth (char-width page-break-lines-char))
|
||||
(wwidth-pix (- (window-width nil t)
|
||||
(if (and (bound-and-true-p display-line-numbers)
|
||||
(fboundp 'line-number-display-width))
|
||||
(line-number-display-width t)
|
||||
0)))
|
||||
(width (- (/ wwidth-pix (frame-char-width) cwidth)
|
||||
(if (display-graphic-p) 0 1)))
|
||||
(width (if page-break-lines-max-width
|
||||
(min width page-break-lines-max-width)
|
||||
width))
|
||||
(glyph (make-glyph-code page-break-lines-char 'page-break-lines))
|
||||
(new-display-entry (vconcat (make-list width glyph))))
|
||||
(unless (equal new-display-entry (elt buffer-display-table ?\^L))
|
||||
(aset buffer-display-table ?\^L new-display-entry)))))
|
||||
(when (and (apply 'derived-mode-p page-break-lines-modes)
|
||||
buffer-display-table)
|
||||
(aset buffer-display-table ?\^L nil))))))
|
||||
|
||||
(defun page-break-lines--update-display-tables (&optional frame)
|
||||
"Function called for updating display table in windows of FRAME."
|
||||
(unless (minibufferp)
|
||||
(mapc 'page-break-lines--update-display-table (window-list frame 'no-minibuffer))))
|
||||
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun page-break-lines-mode-maybe ()
|
||||
"Enable `page-break-lines-mode' in the current buffer if desired.
|
||||
When `major-mode' is listed in `page-break-lines-modes', then
|
||||
`page-break-lines-mode' will be enabled."
|
||||
(if (and (not (minibufferp))
|
||||
(apply 'derived-mode-p page-break-lines-modes))
|
||||
(page-break-lines-mode 1)))
|
||||
|
||||
;;;###autoload
|
||||
(define-global-minor-mode global-page-break-lines-mode
|
||||
page-break-lines-mode page-break-lines-mode-maybe
|
||||
:require 'page-break-lines
|
||||
:group 'page-break-lines)
|
||||
|
||||
|
||||
(provide 'page-break-lines)
|
||||
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; checkdoc-minor-mode: t
|
||||
;; End:
|
||||
|
||||
;;; page-break-lines.el ends here
|
Binary file not shown.
26
init.el
26
init.el
|
@ -1,5 +1,7 @@
|
|||
(setq inhibit-startup-message t)
|
||||
|
||||
(add-hook 'window-setup-hook 'toggle-frame-maximized t)
|
||||
|
||||
(scroll-bar-mode -1) ; Disable visible scrollbar
|
||||
(tool-bar-mode -1) ; Disable the toolbar
|
||||
(tooltip-mode -1) ; Disable tooltips
|
||||
|
@ -7,6 +9,27 @@
|
|||
|
||||
(menu-bar-mode -1) ; Disable the menu bar
|
||||
|
||||
;; setup dashboard
|
||||
|
||||
(require 'dashboard)
|
||||
(use-package dashboard
|
||||
:ensure t
|
||||
:config
|
||||
(dashboard-setup-startup-hook))
|
||||
|
||||
;; Set the title
|
||||
(setq dashboard-banner-logo-title "Welcome to Emacs Dashboard")
|
||||
;; Set the banner
|
||||
(setq dashboard-startup-banner 'logo)
|
||||
;; Value can be
|
||||
;; 'official which displays the official emacs logo
|
||||
;; 'logo which displays an alternative emacs logo
|
||||
;; 1, 2 or 3 which displays one of the text banners
|
||||
;; "path/to/your/image.png" or "path/to/your/text.txt" which displays whatever image/text you would prefer
|
||||
|
||||
;; Content is not centered by default. To center, set
|
||||
(setq dashboard-center-content t)
|
||||
|
||||
|
||||
(set-face-attribute 'default nil :font "Cascadia Code" :height 100)
|
||||
|
||||
|
@ -39,6 +62,7 @@
|
|||
(dolist (mode '(org-mode-hook
|
||||
term-mode-hook
|
||||
shell-mode-hook
|
||||
erc-mode-hook
|
||||
eshell-mode-hook))
|
||||
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||
|
||||
|
@ -89,7 +113,7 @@
|
|||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages
|
||||
'(doom-themes counsel ivy-rich which-key rainbow-delimiters doom-modeline use-package shrink-path ivy command-log-mode all-the-icons)))
|
||||
'(dashboard doom-themes counsel ivy-rich which-key rainbow-delimiters doom-modeline use-package shrink-path ivy command-log-mode all-the-icons)))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
|
|
Loading…
Reference in New Issue