From 93fc6a7c3c8cd715e6e33725ec16268abfef3782 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 16 Nov 2017 16:36:27 +0100 Subject: [PATCH] update demo-it to 20170628.1503 Signed-off-by: Andreas Gerler --- elpa/demo-it-20161103.1337/demo-it-pkg.el | 4 -- .../demo-it-autoloads.el | 8 +-- .../demo-it-custom.el | 3 + .../demo-it-extras.el | 55 ++++++++++++------- elpa/demo-it-20170628.1503/demo-it-pkg.el | 5 ++ .../demo-it-present.el | 0 .../demo-it.el | 45 +++++++++++---- .../demo-it.info | 0 .../dir | 0 9 files changed, 83 insertions(+), 37 deletions(-) delete mode 100644 elpa/demo-it-20161103.1337/demo-it-pkg.el rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/demo-it-autoloads.el (87%) rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/demo-it-custom.el (98%) rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/demo-it-extras.el (69%) create mode 100644 elpa/demo-it-20170628.1503/demo-it-pkg.el rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/demo-it-present.el (100%) rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/demo-it.el (96%) rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/demo-it.info (100%) rename elpa/{demo-it-20161103.1337 => demo-it-20170628.1503}/dir (100%) diff --git a/elpa/demo-it-20161103.1337/demo-it-pkg.el b/elpa/demo-it-20161103.1337/demo-it-pkg.el deleted file mode 100644 index 0f50b055..00000000 --- a/elpa/demo-it-20161103.1337/demo-it-pkg.el +++ /dev/null @@ -1,4 +0,0 @@ -(define-package "demo-it" "20161103.1337" "No description available." 'nil) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/demo-it-20161103.1337/demo-it-autoloads.el b/elpa/demo-it-20170628.1503/demo-it-autoloads.el similarity index 87% rename from elpa/demo-it-20161103.1337/demo-it-autoloads.el rename to elpa/demo-it-20170628.1503/demo-it-autoloads.el index d192a655..c75a57ee 100644 --- a/elpa/demo-it-20161103.1337/demo-it-autoloads.el +++ b/elpa/demo-it-20170628.1503/demo-it-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "demo-it" "demo-it.el" (22560 30366 0 0)) +;;;### (autoloads nil "demo-it" "demo-it.el" (23042 4566 0 0)) ;;; Generated autoloads from demo-it.el (autoload 'demo-it-start "demo-it" "\ @@ -26,8 +26,8 @@ keywords, like `:advanced-mode' and `:variable-width'. ;;;*** -;;;### (autoloads nil "demo-it-present" "demo-it-present.el" (22560 -;;;;;; 30366 0 0)) +;;;### (autoloads nil "demo-it-present" "demo-it-present.el" (23042 +;;;;;; 4566 0 0)) ;;; Generated autoloads from demo-it-present.el (autoload 'demo-it-single-presentation "demo-it-present" "\ @@ -39,7 +39,7 @@ full-screen presentation. SIZE is the text scaling size, and STYLE is the presen ;;;*** ;;;### (autoloads nil nil ("demo-it-custom.el" "demo-it-extras.el" -;;;;;; "demo-it-pkg.el") (22560 30366 0 0)) +;;;;;; "demo-it-pkg.el") (23042 4566 0 0)) ;;;*** diff --git a/elpa/demo-it-20161103.1337/demo-it-custom.el b/elpa/demo-it-20170628.1503/demo-it-custom.el similarity index 98% rename from elpa/demo-it-20161103.1337/demo-it-custom.el rename to elpa/demo-it-20170628.1503/demo-it-custom.el index 3acc7bbb..0dbf2d55 100644 --- a/elpa/demo-it-20161103.1337/demo-it-custom.el +++ b/elpa/demo-it-20170628.1503/demo-it-custom.el @@ -144,6 +144,7 @@ or :slow, :medium or :fast. This can also be a tuple of two integer values for the random number of milliseconds between inserting each character." :type '(choice (const :tag "fast" :fast) + (const :tag "faster" :faster) (const :tag "medium" :medium) (const :tag "slow" :slow) (const :tag "instant" :instant)) @@ -155,6 +156,7 @@ based on the symbol stored in `demo-it--insert-text-speed'. The optional value for SPEED override the default value." (let ((requested-speed (or speed demo-it--insert-text-speed))) (pcase requested-speed + ((or :faster :insert-faster) '(1 . 10)) ((or :fast :insert-fast) '(10 . 100)) ((or :medium :insert-medium) '(30 . 500)) ((or :slow :insert-slow) '(200 . 1000)) @@ -205,6 +207,7 @@ integer matching the symbol specified by SIZE, e.g. `:large'." (:text-huge (setq demo-it--text-scale 5)) (:insert-quickly (setq demo-it--insert-text-speed :instant)) + (:insert-faster (setq demo-it--insert-text-speed :faster)) (:insert-fast (setq demo-it--insert-text-speed :fast)) (:insert-medium (setq demo-it--insert-text-speed :medium)) (:insert-slow (setq demo-it--insert-text-speed :slow)) diff --git a/elpa/demo-it-20161103.1337/demo-it-extras.el b/elpa/demo-it-20170628.1503/demo-it-extras.el similarity index 69% rename from elpa/demo-it-20161103.1337/demo-it-extras.el rename to elpa/demo-it-20170628.1503/demo-it-extras.el index 9034ca3d..52d6b160 100644 --- a/elpa/demo-it-20161103.1337/demo-it-extras.el +++ b/elpa/demo-it-20170628.1503/demo-it-extras.el @@ -53,11 +53,15 @@ "Highlights or narrows to a particular 'section'. If TYPE-OR-FN is a string, it specifies the name of a function to -highlight. If it is a :line, then START and END specifies the +highlight. If it is :line, then START and END specifies the beginning or ending lines. If TYPE-OR-FN is :char, then START and -END are buffer positions. +END are buffer positions. Finally, if TYPE-OR-FN is :regex, then +START and END are regular expressions that refers to a match in +the buffer. -If TYPE-OR-FN is `nil' and region is active, use, the region, +If TYPE-OR-FN is `nil', (or running interactively), then if a +section is currently highlighted/narrowed, it is +unhighlighted/widened. If the region is active, use, the region, otherwise, select the function the point is currently in. If the `fancy-narrow' package is installed, we'll call @@ -75,22 +79,35 @@ we narrow to it." (fancy-narrow-to-region start end) (narrow-to-region start end)) (if (region-active-p) - (deactivate-mark)))) - (cond - ;; Type is null, we assume we are interactive: - ((null type-or-fn) (if (region-active-p) - (hi-region (region-beginning) (region-end)) - (hi-defun))) - - ;; With a specified type, we aren't interactive, and if we got a - ;; symbol, then we can use `demo-it--get-section' for our bounds. - ((symbolp type-or-fn) - (let ((positions (demo-it--get-section type-or-fn start end))) - (hi-region (car positions) (cdr positions)))) - - ;; With string, use `imenu' for matching: - ((stringp type-or-fn) (imenu type-or-fn) - (hi-defun))))) + (deactivate-mark))) + (active-p () + (if (fboundp 'fancy-narrow-active-p) + (fancy-narrow-active-p) + (buffer-narrowed-p))) + (unhighlight () + (if (fboundp 'fancy-narrow-to-region) + (ignore-errors + (fancy-widen)) + (widen)))) + (let ((should-highlight (not (active-p)))) + (unhighlight) + (cond + ;; Type is null, we assume we are interactive: + ((null type-or-fn) (when should-highlight + (if (region-active-p) + (hi-region (region-beginning) (region-end)) + (hi-defun)))) + + ;; With a specified type, we aren't interactive, and if we got a + ;; symbol, then we can use `demo-it--get-section' for our bounds. + ((symbolp type-or-fn) + (let ((positions (demo-it--get-section type-or-fn start end))) + (goto-char (car positions)) + (hi-region (car positions) (cdr positions)))) + + ;; With string, use `imenu' for matching: + ((stringp type-or-fn) (imenu type-or-fn) + (hi-defun)))))) (defun demo-it-load-fancy-file (file type &optional start end side size) diff --git a/elpa/demo-it-20170628.1503/demo-it-pkg.el b/elpa/demo-it-20170628.1503/demo-it-pkg.el new file mode 100644 index 00000000..edc608d3 --- /dev/null +++ b/elpa/demo-it-20170628.1503/demo-it-pkg.el @@ -0,0 +1,5 @@ +(define-package "demo-it" "20170628.1503" "Create demonstrations" 'nil :keywords + '("demonstration" "presentation" "test")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/demo-it-20161103.1337/demo-it-present.el b/elpa/demo-it-20170628.1503/demo-it-present.el similarity index 100% rename from elpa/demo-it-20161103.1337/demo-it-present.el rename to elpa/demo-it-20170628.1503/demo-it-present.el diff --git a/elpa/demo-it-20161103.1337/demo-it.el b/elpa/demo-it-20170628.1503/demo-it.el similarity index 96% rename from elpa/demo-it-20161103.1337/demo-it.el rename to elpa/demo-it-20170628.1503/demo-it.el index c2461961..ced8bd63 100644 --- a/elpa/demo-it-20161103.1337/demo-it.el +++ b/elpa/demo-it-20170628.1503/demo-it.el @@ -1,4 +1,4 @@ -;;; DEMO-IT --- Create demonstrations +;;; demo-it.el --- Create demonstrations ;; ;; Author: Howard Abrams ;; Copyright (C) 2014 Howard Abrams @@ -146,6 +146,7 @@ (define-key map (kbd "") 'demo-it-step) (define-key map (kbd "s-") 'demo-it-insert-text) (define-key map (kbd "A-") 'demo-it-insert-text) + (define-key map (kbd "C-") 'demo-it-highlight-dwim) (define-key map (kbd "M-") 'demo-it-end) map)) @@ -414,20 +415,44 @@ If TYPE is :char or 'char, START and END refers to specific character positions, but if TYPE is :line or 'line, this returns the point positions as if START and END are line numbers." - ;; Due to the way we call this function, we need to allow start and - ;; end to be null, and if so, we select the entire buffer. - (when (or (null start) (null end)) - (setq type :char) - (setq start (point-min)) - (setq end (point-max))) - - (when (or (eq type :line) (eq type 'line)) + (cond + ;; LINE ... resets the START and END positions to be character + ;; positions based on the line numbers given. + ((or (eq type :line) (eq type 'line)) (save-excursion ;; Re-implementing `goto-line' for the win! (goto-char (point-min)) (forward-line (1- start)) (setq start (point)) - (goto-char (point-min)) (forward-line end) + (goto-char (point-min)) (end-of-line end) (setq end (point)))) + + ;; CHAR ... start and end should already be the positions. Unless + ;; START or END are null, in which case, we can assume we are + ;; looking at the end of the buffer. + ((or (eq type :char) (eq type 'char)) + (when (null start) + (setq start (point-min))) + (when (null end) + (setq end (point-max)))) + + ;; REGEXP + ((or (eq type :regex) (eq type :regexp)) + (save-excursion + (goto-char (point-min)) + (re-search-forward start) + (setq start (match-beginning 0)) + (re-search-forward end) + (setq end (match-end 0)))) + + ;; STRING + ((or (eq type :str) (eq type :string)) + (save-excursion + (goto-char (point-min)) + (search-forward start) + (setq start (match-beginning 0)) + (search-forward end) + (setq end (match-end 0))))) + (cons start end)) (defun demo-it-load-part-file (file type start end &optional side size width) diff --git a/elpa/demo-it-20161103.1337/demo-it.info b/elpa/demo-it-20170628.1503/demo-it.info similarity index 100% rename from elpa/demo-it-20161103.1337/demo-it.info rename to elpa/demo-it-20170628.1503/demo-it.info diff --git a/elpa/demo-it-20161103.1337/dir b/elpa/demo-it-20170628.1503/dir similarity index 100% rename from elpa/demo-it-20161103.1337/dir rename to elpa/demo-it-20170628.1503/dir -- 2.47.3