Skip to content

Commit dd63d76

Browse files
committed
smart-org - Fix to support Hyperbole EOL handling
Change 'Assumes' to 'Assume' in many docstrings.
1 parent eac1b1c commit dd63d76

File tree

8 files changed

+33
-18
lines changed

8 files changed

+33
-18
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
hib-org.el: Move remaining action types to hsys-org.el and delete
2323
this file.
2424
test/hib-org-tests.el: Rename to test/smart-org-tests.el.
25+
hui-mouse.el (action-key-error, assist-key-error): When in Org mode,
26+
if no other context fired, use org-meta-return.
27+
hsys-org.el (hsys-org-heading-at-p): Add to support Hyperbole
28+
EOL handling and use in smart-org.
29+
2530

2631
* kotl/kotl-mode.el (kotl-mode:kill-whole-line): Add override
2732
of kill-whole-line for Koutliner.

hbut.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Return nil if no matching button is found."
174174
"Return key for the Hyperbole explicit button label that point is within, else nil.
175175
This is the normalized key form of the explicit button's label.
176176
177-
Assumes point is within the first line of any button label. All
177+
Assume point is within the first line of any button label. All
178178
following arguments are optional. If AS-LABEL is non-nil, label
179179
is returned rather than the key derived from the label.
180180
START-DELIM and END-DELIM are strings that override default

hsys-org.el

+10-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ uses that one. Otherwise, triggers an error."
155155

156156
(defun hsys-org-link-at-p ()
157157
"Return non-nil iff point is on an Org mode link.
158-
Assumes caller has already checked that the current buffer is in `org-mode'
158+
Assume caller has already checked that the current buffer is in `org-mode'
159159
or are looking for an Org link in another buffer type."
160160
(or (and (boundp 'org-link-bracket-re)
161161
(org-in-regexp org-link-bracket-re))
@@ -165,10 +165,16 @@ or are looking for an Org link in another buffer type."
165165
(not (null org-target-link-regexp))
166166
(org-in-regexp org-target-link-regexp))))
167167

168-
;; Assumes caller has already checked that the current buffer is in org-mode.
168+
;; Assume caller has already checked that the current buffer is in org-mode.
169+
(defun hsys-org-heading-at-p (&optional _)
170+
"Non-nil when on a headline."
171+
(unless (eolp)
172+
(outline-on-heading-p t)))
173+
174+
;; Assume caller has already checked that the current buffer is in org-mode.
169175
(defun hsys-org-target-at-p ()
170-
"Return non-nil iff point is on an Org mode radio target (definition) or link target (referent).
171-
Assumes caller has already checked that the current buffer is in `org-mode'."
176+
"Return non-nil iff point is on an Org mode radio target (definition) or radio target link (referent).
177+
Assume caller has already checked that the current buffer is in `org-mode'."
172178
(hsys-org-face-at-p 'org-target))
173179

174180
(defun hsys-org-radio-target-link-at-p ()

hui-mouse.el

+8-4
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ If assist-key is pressed within:
992992

993993
(defun smart-helm-line-has-action ()
994994
"Mark and return the actions for the helm selection item at the point of Action Key depress, or nil if line lacks any action.
995-
Assumes Hyperbole has already checked that helm is active."
995+
Assume Hyperbole has already checked that helm is active."
996996
(let ((helm-buffer (if (equal helm-action-buffer (buffer-name)) helm-buffer (buffer-name))))
997997
(save-excursion
998998
(with-helm-buffer
@@ -1027,7 +1027,7 @@ Assumes Hyperbole has already checked that helm is active."
10271027
"Return non-nil iff Smart Mouse DEPRESS-EVENT was on a helm section header, candidate separator or at eob or eol.
10281028
If non-nil, returns a property list of the form: (section-header <bool> separator <bool> eob <bool> or eol <bool>).
10291029
If a section-header or separator, selects the first following candidate line.
1030-
Assumes Hyperbole has already checked that helm is active."
1030+
Assume Hyperbole has already checked that helm is active."
10311031
(and (eventp depress-event)
10321032
;; Nil means in the buffer text area
10331033
(not (posn-area (event-start depress-event)))
@@ -1629,7 +1629,7 @@ handled by the separate implicit button type, `org-link-outside-org-mode'."
16291629
(hact 'hkey-help))
16301630
;; Ignore any further Smart Key non-Org contexts
16311631
t)
1632-
((org-at-heading-p)
1632+
((hsys-org-heading-at-p)
16331633
(if (not assist-flag)
16341634
(hact 'hsys-org-cycle)
16351635
(hact 'hsys-org-global-cycle))
@@ -1638,14 +1638,18 @@ handled by the separate implicit button type, `org-link-outside-org-mode'."
16381638
;; Continue with any further Smart Key non-Org contexts
16391639
nil))))
16401640
((eq hsys-org-enable-smart-keys 'buttons)
1641+
(when (hbut:at-p)
1642+
;; Activate/Assist with any Hyperbole button at point
1643+
(if (not assist-flag)
1644+
(hact 'hbut:act)
1645+
(hact 'hkey-help)))
16411646
;; Ignore any further Smart Key non-Org contexts
16421647
t)
16431648
(t
16441649
;; hsys-org-enable-smart-keys is set to t, so try other Smart
16451650
;; contexts
16461651
nil))))
16471652

1648-
16491653
;;; ************************************************************************
16501654
;;; smart-outline functions
16511655
;;; ************************************************************************

hui-select.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Return t if marked, nil otherwise. If any error occurs such as
674674

675675
(defun hui-select-at-blank-line-or-comment ()
676676
"Return non-nil if on a blank line or a comment start or end line.
677-
Assumes point is before any non-whitespace character on the line."
677+
Assume point is before any non-whitespace character on the line."
678678
(let ((comment-end-p (and (stringp comment-end)
679679
(not (string-equal comment-end "")))))
680680
(if (looking-at

hyrolo.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ XEmacs only."
619619
;;;###autoload
620620
(defun hyrolo-sort (&optional hyrolo-file)
621621
"Sort up to 14 levels of entries in HYROLO-FILE (default is personal rolo).
622-
Assumes entries are delimited by one or more `*'characters.
622+
Assume entries are delimited by one or more `*'characters.
623623
Return list of number of groupings at each entry level."
624624
(interactive
625625
(list (let ((default "")

kotl/kfile.el

+3-3
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ VISIBLE-ONLY-P is non-nil. Signal an error if kotl is not attached to a file."
356356

357357
(defun kfile:build-structure-v2 (kotl-structure cell-data)
358358
"Build cell list from the KOTL-STRUCTURE and its CELL-DATA.
359-
Assumes all arguments are valid. CELL-DATA is a vector of cell fields read
359+
Assume all arguments are valid. CELL-DATA is a vector of cell fields read
360360
from a koutline file.
361361
362362
Return list of outline cells in depth first order. Invisible top cell is not
@@ -386,7 +386,7 @@ included in the list."
386386

387387
(defun kfile:insert-attributes-v2 (kview kcell-list)
388388
"Set cell attributes within KVIEW for each element in KCELL-LIST.
389-
Assumes all cell contents are already in kview and that no cells are
389+
Assume all cell contents are already in kview and that no cells are
390390
hidden."
391391
(let (buffer-read-only)
392392
(while
@@ -404,7 +404,7 @@ hidden."
404404

405405
(defun kfile:insert-attributes-v3 (kview kcell-vector)
406406
"Set cell attributes within KVIEW for each element in KCELL-VECTOR.
407-
Assumes all cell contents are already in kview and that no cells are
407+
Assume all cell contents are already in kview and that no cells are
408408
hidden."
409409
(let ((kcell-num 1)
410410
(buffer-read-only))

set.el

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Use (setq set (set:remove elt set)) to assure set is always properly modified."
6969

7070
(defun set:combinations (set &optional arity)
7171
"Return all possible combinations (subsets) of SET including the empty set and the SET itself.
72-
Assumes SET is a valid set. With optional ARITY, return only subsets with
72+
Assume SET is a valid set. With optional ARITY, return only subsets with
7373
ARITY members."
7474
(cond ((null arity)
7575
(setq arity 0)
@@ -126,7 +126,7 @@ Uses `set:equal-op' for comparison."
126126

127127
(defun set:get (key set)
128128
"Return the value associated with KEY in SET or nil.
129-
Assumes elements of SET are of the form (key . value)."
129+
Assume elements of SET are of the form (key . value)."
130130
(cdr (car (let ((set:equal-op (lambda (key elt) (equal key (car elt)))))
131131
(set:member key set)))))
132132

@@ -164,8 +164,8 @@ Uses `set:equal-op' for comparison. See also `set:create'."
164164
Return set if modified, else nil.
165165
Use (setq set (set:replace elt set)) to assure set is always properly modified.
166166
167-
Uses `set:equal-op' to match against KEY. Assumes each element in the set
168-
has a car and a cdr."
167+
Use `set:equal-op' to match against KEY. Assume each element in the set has a
168+
car and a cdr."
169169
(let ((elt-set (set:member key set)))
170170
(if elt-set
171171
;; replace element

0 commit comments

Comments
 (0)