emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole a227270 2/3: Change kotl-mode:mail-tree bindi


From: ELPA Syncer
Subject: [elpa] externals/hyperbole a227270 2/3: Change kotl-mode:mail-tree binding from {C-c @} to {C-c C-@}
Date: Mon, 10 May 2021 20:57:10 -0400 (EDT)

branch: externals/hyperbole
commit a227270989add44956c3b9d3c6b8fcc6352e8b23
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Change kotl-mode:mail-tree binding from {C-c @} to {C-c C-@}
---
 ChangeLog              |  10 ++++++++++
 DEMO                   |   2 +-
 HY-NEWS                |   6 ++++++
 hsys-org.el            |  39 ++++++++++++++++++++++-----------------
 hyperbole.el           |  23 +++++++++++++++--------
 kotl/EXAMPLE.kotl      |   4 ++--
 kotl/kotl-autoloads.el |  20 ++++++++++++++------
 kotl/kotl-mode.el      |  15 +++++++++++----
 kotl/kview.el          |   4 ++--
 man/hyperbole.html     |  14 +++++++-------
 man/hyperbole.info     | Bin 554837 -> 554841 bytes
 man/hyperbole.pdf      | Bin 1309400 -> 1309421 bytes
 man/hyperbole.texi     |   4 ++--
 13 files changed, 92 insertions(+), 49 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4ca5a1e..26cb169 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-05-10  Bob Weiner  <rsw@gnu.org>
+
+* kotl/kview.el (kcell-view:label): Remove unneeded properties
+    from returned string.
+
+* man/hyperbole.texi (Relocating and Copying, Koutliner Keys):
+  kotl/kotl-mode.el (kotl-mode-map): Change binding of
+    kotl-mode:mail-tree from {C-c @} to {C-c C-@} to
+    prevent conflict with hycontrol-windows-grid binding.
+
 2021-05-09  Bob Weiner  <rsw@gnu.org>
 
 * test/demo-tests.el (demo-org-hide-header-test): Fix, add
diff --git a/DEMO b/DEMO
index c563e09..e915383 100644
--- a/DEMO
+++ b/DEMO
@@ -300,7 +300,7 @@ If you ever need to experiment with different sized window 
grids, use
 for a grid size and then display it.  When you are done, simply press RET
 to exit.
 
-Outside of HyControl, you can invoke the grid of windows command with C-c @
+Outside of HyControl, you can invoke the grid of windows command with {C-c @}
 in most buffers.
 
 There is lots more to discover in HyControl as you explore.
diff --git a/HY-NEWS b/HY-NEWS
index ee4205b..3b8ab57 100644
--- a/HY-NEWS
+++ b/HY-NEWS
@@ -63,6 +63,12 @@
      Koutliner via Org table minor mode.  Use {M-x orgtbl-mode RET} to
      toggle this on and off.  See "(Org)Tables" for details.
 
+   - New Mail Tree Key Binding: The kotl-mode:mail-tree command that
+     extracts the current view of a Koutline in text-only format and
+     creates an outgoing email messge with it, has moved from {C-c @}
+     to {C-c C-@} to prevent conflict with the hycontrol-window-grid
+     command bound to {C-c @}.
+
    - New Tree Demotion/Promotion Keys: Tree promotion and demotion keys now
      match the defaults in Org mode and Outline mode, plus some easier to
      type ones.  The tables below summarize which keys work whether inside
diff --git a/hsys-org.el b/hsys-org.el
index 291a70d..948ce34 100644
--- a/hsys-org.el
+++ b/hsys-org.el
@@ -169,23 +169,28 @@ uses that one.  Otherwise, triggers an error."
   "Return non-nil iff point is on an Org mode link.
 Assume caller has already checked that the current buffer is in `org-mode'
 or are looking for an Org link in another buffer type."
-  (let* ((context
-         ;; Only consider supported types, even if they are not
-         ;; the closest one.
-         (org-element-lineage
-          (org-element-context)
-          '(clock footnote-definition footnote-reference headline
-                  inlinetask link timestamp)
-          t))
-        (type (org-element-type context)))
-    (or (eq type 'link)
-       (and (boundp 'org-link-bracket-re)
-            (org-in-regexp org-link-bracket-re))
-       (and (boundp 'org-bracket-link-regexp)
-            (org-in-regexp org-bracket-link-regexp))
-       (and (boundp 'org-target-link-regexp)
-             (not (null org-target-link-regexp))
-             (org-in-regexp org-target-link-regexp)))))
+  ;; If any Org test fails, just return nil
+  (condition-case ()
+      (let* ((context
+             ;; Only consider supported types, even if they are not
+             ;; the closest one.
+             (org-element-lineage
+              ;; Next line can trigger an error when `looking-at' is called
+              ;; with a `nil' value of `org-complex-heading-regexp'.
+              (org-element-context)
+              '(clock footnote-definition footnote-reference headline
+                      inlinetask link timestamp)
+              t))
+            (type (org-element-type context)))
+       (or (eq type 'link)
+           (and (boundp 'org-link-bracket-re)
+                (org-in-regexp org-link-bracket-re))
+           (and (boundp 'org-bracket-link-regexp)
+                (org-in-regexp org-bracket-link-regexp))
+           (and (boundp 'org-target-link-regexp)
+                (not (null org-target-link-regexp))
+                (org-in-regexp org-target-link-regexp))))
+    (error nil)))
 
 ;; Assume caller has already checked that the current buffer is in org-mode.
 (defun hsys-org-heading-at-p (&optional _)
diff --git a/hyperbole.el b/hyperbole.el
index e02102c..f7f6209 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -410,8 +410,9 @@ frame, those functions by default still return the prior 
frame."
 ;;; ************************************************************************
 
 ;; New autoload generation function defined only in Emacs 28
-(unless (fboundp #'make-directory-autoloads)
-  (defalias 'make-directory-autoloads 'update-directory-autoloads))
+;; (unless (fboundp #'make-directory-autoloads)
+;;  ;; Don't use defalias on next line; causes a failure
+;;  (fset 'make-directory-autoloads 'update-directory-autoloads))
 
 ;; Koutliner autoloads in the kotl/ subdirectory are generated by 'make pkg'.
 ;; This next line ensures they are loaded by hyperbole-autoloads whenever
@@ -450,7 +451,7 @@ frame, those functions by default still return the prior 
frame."
 ;;          (backup-inhibited t)
 ;;          (version-control 'never))
 ;;     (package-autoload-ensure-default-file generated-autoload-file)
-;;     (apply #'make-directory-autoloads pkg-dir
+;;     (apply #'update-directory-autoloads pkg-dir
 ;;            (delq nil (mapcar (lambda (f) (and (file-directory-p f)
 ;;                                               (not (file-symlink-p f))
 ;;                                               f))
@@ -661,11 +662,17 @@ This is used only when running from git source and not a 
package release."
 (defun hyperb:generate-autoloads ()
   "Renerate Hyperbole *-autoload.el files whether they already exist or not."
   (let* ((default-directory hyperb:dir)
-        (generated-autoload-file (expand-file-name "hyperbole-autoloads.el"))
-        (backup-inhibited t))
-    (make-directory-autoloads ".")
-    (setq generated-autoload-file (expand-file-name "kotl/kotl-autoloads.el"))
-    (make-directory-autoloads "kotl/"))
+        (backup-inhibited t)
+        (al-file (expand-file-name "hyperbole-autoloads.el"))
+        (generated-autoload-file))
+    ;; (make-local-variable 'generated-autoload-file)
+    (with-current-buffer (find-file-noselect al-file)
+      (setq generated-autoload-file al-file)
+      (update-directory-autoloads "."))
+    (setq al-file (expand-file-name "kotl/kotl-autoloads.el"))
+    (with-current-buffer (find-file-noselect al-file)
+      (setq generated-autoload-file al-file)
+      (update-directory-autoloads "kotl/")))
   (unless (hyperb:autoloads-exist-p)
     (error (format "Hyperbole failed to generate autoload files; try running 
'make src' in a shell in %s" hyperb:dir))))
 
diff --git a/kotl/EXAMPLE.kotl b/kotl/EXAMPLE.kotl
index 8447400..df1efe6 100644
--- a/kotl/EXAMPLE.kotl
+++ b/kotl/EXAMPLE.kotl
@@ -102,7 +102,7 @@
            don't use them to move trees across different outline files.  You
            can, however, copy an outline tree to a non-outline buffer with:
             {C-c M-c}     - Copy a koutline tree to a non-koutline buffer.
-            {C-c @}       - Copy a koutline tree to an outgoing mail message.
+            {C-c C-@}     - Copy a koutline tree to an outgoing mail message.
            
             {C-c c}       - Copy <tree> to follow as sibling of <cell>.
             {C-u C-c c}   - Copy <tree> to follow as first child of <cell>.
@@ -369,7 +369,7 @@ alpha ;; label-type
 
 ;; depth-first kcell attributes
 [[0
-  (creator "rsw@gnu.org" create-time "20170928:19:50:05" id-counter 77 file 
"/Users/bk/sw-dev/emacs/hyperbole/kotl/EXAMPLE.kotl")]
+  (creator "rsw@gnu.org" create-time "20210510:04:09:59" id-counter 77 file 
"/Users/bk/Dropbox/emacs/hyperbole/kotl/EXAMPLE.kotl")]
  [20
   (creator "rsw@gnu.org" create-time "19940104:17:38:28" no-fill t)]
  [75
diff --git a/kotl/kotl-autoloads.el b/kotl/kotl-autoloads.el
index f33cfa6..28348d1 100644
--- a/kotl/kotl-autoloads.el
+++ b/kotl/kotl-autoloads.el
@@ -37,7 +37,9 @@ Return the new kview.
 \(fn FILE-NAME)" t nil)
 
 (autoload 'kfile:is-p "kfile" "\
-Iff current buffer contains an unformatted or formatted koutline, return file 
format version string, else nil." nil nil)
+Iff current buffer contains an unformatted or formatted koutline, return file 
format version string, else nil.
+
+\(fn)" nil nil)
 
 (autoload 'kfile:view "kfile" "\
 View an existing kotl version-2 file FILE-NAME in a read-only mode.
@@ -194,10 +196,14 @@ See documentation for `kcell:ref-to-id' for valid 
cell-ref formats.
 (autoload 'kotl-mode "kotl-mode" "\
 The major mode used to edit and view koutlines.
 It provides the following keys:
-\\{kotl-mode-map}" t nil)
+\\{kotl-mode-map}
+
+\(fn)" t nil)
 
 (autoload 'kotl-mode:example "kotl-mode" "\
-Display the Koutliner example file for demonstration use by a user." t nil)
+Display the Koutliner example file for demonstration use by a user.
+
+\(fn)" t nil)
 
 (autoload 'kotl-mode:overview "kotl-mode" "\
 Show the first line of each cell.
@@ -229,9 +235,11 @@ Display fully expanded tree rooted at CELL-REF.
 \(fn &optional CELL-REF)" t nil)
 
 (autoload 'kotl-mode:is-p "kotl-mode" "\
-Signal an error if current buffer is not a Hyperbole outline, else return t." 
nil nil)
+Signal an error if current buffer is not a Hyperbole outline, else return t.
+
+\(fn)" nil nil)
 
-(register-definition-prefixes "kotl-mode" '("delete-selection-pre-hook" 
"kotl-mode" "yank-"))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"kotl-mode" '("delete-selection-pre-hook" "kotl-mode" "yank-")))
 
 ;;;***
 
@@ -259,7 +267,7 @@ Signal an error if current buffer is not a Hyperbole 
outline, else return t." ni
 ;;;### (autoloads nil "kview" "kview.el" (0 0 0 0))
 ;;; Generated autoloads from kview.el
 
-(register-definition-prefixes "kview" '("kcell-view:" "kview:"))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"kview" '("kcell-view:" "kview:")))
 
 ;;;***
 
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index 18d141a..16b5ceb 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -80,9 +80,12 @@ It provides the following keys:
       ;; defined in kfill.el, so reload it.
       (load "kfill"))
   (setq-local fill-paragraph-function #'kfill:fill-paragraph)
+  ;;
   ;; Prevent insertion of characters outside of editable bounds,
   ;; e.g. after the mouse sets point to a non-editable position
-  (add-hook 'pre-command-hook #'kotl-mode:pre-self-insert-command)
+  ;; !! TODO: This was causing kotl-mode:demote-tree (and promote) to fail
+  ;; (add-hook 'pre-command-hook #'kotl-mode:pre-self-insert-command)
+  ;;
   ;; Ensure that outline structure data is saved when save-buffer is called
   ;; from save-some-buffers, {C-x s}.
   (add-hook 'local-write-file-hooks #'kotl-mode:update-buffer)
@@ -2908,8 +2911,12 @@ newlines at end of tree."
   "If within a Koutline, prior to inserting a character, ensure point is in an 
editable position.
 Mouse may have moved point outside of an editable area. kotl-mode adds
 this function to `pre-command-hook'."
-  (when (and (eq major-mode 'kotl-mode)
-            (not (kview:valid-position-p)))
+  (when (and (eq this-command 'self-insert-command)
+            (called-interactively-p 'interactive)
+            (eq major-mode 'kotl-mode)
+            (not (kview:valid-position-p))
+            ;; Prevent repeatedly moving point to valid position when moving 
trees
+            (not (hyperb:stack-frame '(kcell-view:to-label-end))))
     (let ((start (kcell-view:start))
          (end (kcell-view:end-contents)))
       (cond ((and (<= start (point)) (<= (point) end))
@@ -3169,7 +3176,7 @@ Leave point at end of line now residing at START."
 
 
   ;; kotl-mode keys
-  (define-key kotl-mode-map "\C-c@"     'kotl-mode:mail-tree)
+  (define-key kotl-mode-map "\C-c\C-@"  'kotl-mode:mail-tree)
   (define-key kotl-mode-map "\C-c+"     'kotl-mode:append-cell)
   (define-key kotl-mode-map "\C-c,"     'kotl-mode:beginning-of-cell)
   (define-key kotl-mode-map "\C-c."     'kotl-mode:end-of-cell)
diff --git a/kotl/kview.el b/kotl/kview.el
index 477706c..d346ea2 100644
--- a/kotl/kview.el
+++ b/kotl/kview.el
@@ -325,8 +325,8 @@ If labels are off, return cell's idstamp as a string."
       (if (eq label-type 'no)
          (kcell-view:idstamp)
        (kcell-view:to-label-end)
-       (buffer-substring (point) (progn (skip-chars-backward "^ \t\n\r")
-                                        (point)))))))
+       (buffer-substring-no-properties (point) (progn (skip-chars-backward "^ 
\t\n\r")
+                                                      (point)))))))
 
 (defun kcell-view:level (&optional pos label-sep-len indent)
   "Return the outline level of the current cell or the one at optional POS.
diff --git a/man/hyperbole.html b/man/hyperbole.html
index fb640b8..413c0ab 100644
--- a/man/hyperbole.html
+++ b/man/hyperbole.html
@@ -5389,9 +5389,9 @@ You can, however, copy an outline tree to a non-outline 
buffer with:
 </dd>
 <dt><kbd>{C-c M-c}</kbd></dt>
 <dd><p>Copy a &lt;tree&gt; to a non-koutline buffer.
-<span id="index-C_002dc-_0040"></span>
+<span id="index-C_002dc-C_002d_0040"></span>
 </p></dd>
-<dt><kbd>{C-c @ }</kbd></dt>
+<dt><kbd>{C-c C-@ }</kbd></dt>
 <dd><p>Copy a &lt;tree&gt; to an outgoing mail message.
 </p></dd>
 </dl>
@@ -8917,11 +8917,11 @@ associated search.  This binding is made only if the 
key is not bound
 prior to loading Hyperbole; otherwise, the Find/Web minibuffer menu
 item, <kbd>{C-h h f w}</kbd>, will do the same thing.
 </p>
-<span id="index-C_002dc-_0040-1"></span>
+<span id="index-C_002dc-_0040"></span>
 <span id="index-key-binding_002c-C_002dc-_0040"></span>
 <span id="index-windows-grid-1"></span>
 <span id="index-grid-of-windows-1"></span>
-<span id="index-C_002dc-_0040-2"></span>
+<span id="index-C_002dc-_0040-1"></span>
 </dd>
 <dt><kbd>{C-c @}</kbd></dt>
 <dd><p>Display a grid of windows in the selected frame, sized according to the
@@ -9475,7 +9475,7 @@ already within the last sibling cell.
 </p>
 <span id="index-kotl_002dmode_003amail_002dtree"></span>
 </dd>
-<dt><code>kotl-mode:mail-tree  <kbd>{C-c @}</kbd></code></dt>
+<dt><code>kotl-mode:mail-tree  <kbd>{C-c C-@}</kbd></code></dt>
 <dd><p>Mail outline tree rooted at CELL-REF.  Use &quot;0&quot; for whole 
outline buffer.
 </p>
 <span id="index-kotl_002dmode_003amove_002dafter"></span>
@@ -12153,10 +12153,10 @@ Next: <a href="#Function" accesskey="n" 
rel="next">Function</a>, Previous: <a hr
 <tr><td></td><td valign="top"><a href="#index-C_002dc-_002f-2"><code>C-c 
/</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Default-Hyperbole-Bindings">Default Hyperbole Bindings</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-_003c"><code>C-c 
&lt;</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Moving-Around">Moving Around</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-_003e"><code>C-c 
&gt;</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Moving-Around">Moving Around</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-C_002dc-_0040"><code>C-c 
@</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Relocating-and-Copying">Relocating and Copying</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-C_002dc-_0040"><code>C-c 
@</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Default-Hyperbole-Bindings">Default Hyperbole Bindings</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-_0040-1"><code>C-c 
@</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Default-Hyperbole-Bindings">Default Hyperbole Bindings</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-C_002dc-_0040-2"><code>C-c 
@</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Default-Hyperbole-Bindings">Default Hyperbole Bindings</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-c"><code>C-c 
c</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Relocating-and-Copying">Relocating and Copying</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-C_002dc-C_002d_0040"><code>C-c 
C-@</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Relocating-and-Copying">Relocating and Copying</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-C_002da"><code>C-c 
C-a</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Hiding-and-Showing">Hiding and Showing</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-C_002db"><code>C-c 
C-b</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Moving-Around">Moving Around</a></td></tr>
 <tr><td></td><td valign="top"><a href="#index-C_002dc-C_002dc"><code>C-c 
C-c</code></a>:</td><td>&nbsp;</td><td valign="top"><a 
href="#Implicit-Button-Types">Implicit Button Types</a></td></tr>
diff --git a/man/hyperbole.info b/man/hyperbole.info
index fb9463e..84a60de 100644
Binary files a/man/hyperbole.info and b/man/hyperbole.info differ
diff --git a/man/hyperbole.pdf b/man/hyperbole.pdf
index a875d01..ce1d4ca 100644
Binary files a/man/hyperbole.pdf and b/man/hyperbole.pdf differ
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 29e48ae..f9bbd36 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -4523,7 +4523,7 @@ You can, however, copy an outline tree to a non-outline 
buffer with:
 @table @asis
 @kitem C-c M-c
 Copy a <tree> to a non-koutline buffer.
-@kitem C-c @@ 
+@kitem C-c C-@@
 Copy a <tree> to an outgoing mail message.
 @end table
 
@@ -8105,7 +8105,7 @@ Leave point at the start of the cell or at its present 
position if it is
 already within the last sibling cell.
 
 @findex kotl-mode:mail-tree
-@item kotl-mode:mail-tree  @bkbd{C-c @@}
+@item kotl-mode:mail-tree  @bkbd{C-c C-@@}
 Mail outline tree rooted at CELL-REF.  Use "0" for whole outline buffer.
 
 @findex kotl-mode:move-after



reply via email to

[Prev in Thread] Current Thread [Next in Thread]