branch: externals/hyperbole commit dcb0b9e7aade7da581edabaa6263fad9b9ae7ca8 Merge: 716507c51c 89913d256c Author: Bob Weiner <r...@gnu.org> Commit: Bob Weiner <r...@gnu.org>
Merge branch 'master' of hyperbole; initial 80-col comment fixes --- ChangeLog | 58 ++++++++++++++++++++++++++++++++++++--------------------- hact.el | 32 +++++++++++++++++-------------- hactypes.el | 14 ++++++++------ hargs.el | 10 ++++++---- hbdata.el | 22 ++++++++++++---------- hib-debbugs.el | 40 ++++++++++++++++++++++----------------- hmouse-tag.el | 3 ++- kotl/kcell.el | 9 +++++---- kotl/kexport.el | 44 ++++++++++++++++++++++++------------------- 9 files changed, 136 insertions(+), 96 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20459163a1..730e8c9aa8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,36 +61,28 @@ attribute. Remove '(or args)' as that was preventing set of hbut:current attributes. -2022-07-17 Bob Weiner <r...@gnu.org> - -* hmouse-drv.el (hkey-debug): Add print of all button properties when on - a Hyperbole button. - -* hsettings.el (hyperbole-web-search): Add optional 'return-search-expr-flag' - to return search expression rather than doing the search. Use - with Assist Key. - -* hibtypes.el (action): Call ibut:create to ensure button attributes - are set properly. - hbut.el (ibut:create): Return nil if at end-of-buffer. +2022-07-21 Mats Lidell <ma...@gnu.org> -* hui-mouse.el (smart-imenu-item-p): Support -99 position value - that Emacs uses to indicate a rescan should be done. +* kotl/kexport.el: +* kotl/kcell.el: Shorten docs strings to be within 80 char limit. -* test/demo-tests.el (fast-demo-key-series-shell-cd-hyperb-dir, - fast-demo-key-series-shell-grep, - fast-demo-key-series-shell-apropos): - Use 'sh' instead of 'bash' for wider applicability. - Don't kill shell buffer if it exists before the test is invoked. +2022-07-20 Mats Lidell <ma...@gnu.org> -* hact.el (htype:symbol): Return nil if type-category is invalid. +* hact.el: +* hmouse-tag.el: +* hbdata.el: +* hactypes.el: +* hib-debbugs.el: +* hargs.el: Shorten docs strings to be within 80 char limit. -2022-07-17 Mats Lidell <ma...@gnu.org> +2022-07-19 Mats Lidell <ma...@gnu.org> * test/demo-tests.el (fast-demo-key-series-shell-apropos): Add optional whitespace after command to accomodate for different versions on apropos. +2022-07-17 Mats Lidell <ma...@gnu.org> + * hypb.el (hypb:replace-match-string): Fix obsolete version to 8.0.1. * kotl/kotl-mode.el (kotl-mode:beginning-of-line): Rename from @@ -115,6 +107,30 @@ (kcell-view:lines-visible, kview:set-cells-status): Use it. (label-sep-len): Mark variable as obsolete. Use kview-label-sep-len. +2022-07-17 Bob Weiner <r...@gnu.org> + +* hmouse-drv.el (hkey-debug): Add print of all button properties when on + a Hyperbole button. + +* hsettings.el (hyperbole-web-search): Add optional 'return-search-expr-flag' + to return search expression rather than doing the search. Use + with Assist Key. + +* hibtypes.el (action): Call ibut:create to ensure button attributes + are set properly. + hbut.el (ibut:create): Return nil if at end-of-buffer. + +* hui-mouse.el (smart-imenu-item-p): Support -99 position value + that Emacs uses to indicate a rescan should be done. + +* test/demo-tests.el (fast-demo-key-series-shell-cd-hyperb-dir, + fast-demo-key-series-shell-grep, + fast-demo-key-series-shell-apropos): + Use 'sh' instead of 'bash' for wider applicability. + Don't kill shell buffer if it exists before the test is invoked. + +* hact.el (htype:symbol): Return nil if type-category is invalid. + 2022-07-15 Mats Lidell <ma...@gnu.org> * test/hypb-tests.el: Remove test cases for hypb:replace-match-string. diff --git a/hact.el b/hact.el index 9ad080418c..5a8ecd3963 100644 --- a/hact.el +++ b/hact.el @@ -1,9 +1,9 @@ -;;; hact.el --- GNU Hyperbole button action handling -*- lexical-binding: t; -*- +;;; hact.el --- GNU Hyperbole button action handling -*- lexical-binding: t; -let*- ;; ;; Author: Bob Weiner ;; ;; Orig-Date: 18-Sep-91 at 02:57:09 -;; Last-Mod: 23-Jul-22 at 21:25:44 by Bob Weiner +;; Last-Mod: 24-Jul-22 at 10:58:30 by Bob Weiner ;; ;; Copyright (C) 1991-2021 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. @@ -49,11 +49,12 @@ The type categories are either 'actypes or 'ibtypes.") (plist-get symtable 'name)) (defsubst symtable:select (type-category) - "Inline the return of the symtable for TYPE-CATEGORY, one of 'actypes or 'ibtypes." + "Inline the return of the symtable for TYPE-CATEGORY. +TYPE-CATEGORY is one of `actypes' or `ibtypes'." (plist-get symtable:category-plist type-category)) (defun symtable:operate (operation symbol-or-name symtable) - "Call hash-table function OPERATION with Hyperbole SYMBOL-OR-NAME as key upon SYMTABLE. + "Call hash-table OPERATION with Hyperbole SYMBOL-OR-NAME key for SYMTABLE. Trigger an error if SYMBOL-OR-NAME cannot be mapped to an existing Elisp symbol or if SYMTABLE is invalid." (let ((name (cond ((stringp symbol-or-name) @@ -112,12 +113,12 @@ with the `ibtypes::' prefix and one without. The value for both keys is the Elisp symbol for the type, which includes the prefix.") (defsubst symtable:actype-p (symbol-or-name) - "Return the Elisp symbol given by SYMBOL-OR-NAME if it is a Hyperbole action type name, else nil." + "Return SYMBOL-OR-NAME if it is a Hyperbole action type, else nil." (when (or (symbolp symbol-or-name) (stringp symbol-or-name)) (symtable:get symbol-or-name symtable:actypes))) (defsubst symtable:ibtype-p (symbol-or-name) - "Return the Elisp symbol given by SYMBOL-OR-NAME if it is a Hyperbole implicit button type name, else nil." + "Return SYMBOL-OR-NAME if it is a Hyperbole implicit button type, else nil." (when (or (symbolp symbol-or-name) (stringp symbol-or-name)) (symtable:get symbol-or-name symtable:ibtypes))) @@ -130,12 +131,12 @@ Caller must ensure SYMBOL-OR-NAME is a symbol or string." (defalias 'symtable:delete #'symtable:remove) (defun symtable:get (symbol-or-name symtable) - "Return the Elisp symbol given by Hyperbole SYMBOL-OR-NAME if it is in existing SYMTABLE, else nil. + "Return Hyperbole SYMBOL-OR-NAME if it is in SYMTABLE, else nil. Caller must ensure SYMBOL-OR-NAME is a symbol or string." (symtable:operate #'gethash symbol-or-name symtable)) (defun symtable:remove (symbol-or-name symtable) - "Remove the Elisp symbol given by Hyperbole SYMBOL-OR-NAME if it is in existing SYMTABLE. + "Remove the Hyperbole SYMBOL-OR-NAME if it is in SYMTABLE. Always return nil. Caller must ensure SYMBOL-OR-NAME is a symbol or string." (symtable:operate #'remhash symbol-or-name symtable)) @@ -247,7 +248,7 @@ Return the Hyperbole symbol for the TYPE if it existed, else nil." (documentation type)) (defun htype:names (type-category &optional sym) - "Return a list of the current definition names for TYPE-CATEGORY in priority order. + "Return a list of current definition names for TYPE-CATEGORY in priority order. Definition names do not contain the category prefix. TYPE-CATEGORY should be `actypes', `ibtypes' or nil for all. When optional SYM is given, returns the name for that symbol only, if any." @@ -264,8 +265,9 @@ When optional SYM is given, returns the name for that symbol only, if any." ;;; ------------------------------------------------------------------------ (defun htype:symbol (type type-category) - "Return possibly new Hyperbole type symbol composed from TYPE and TYPE-CATEGORY (both symbols). -TYPE-CATEGORY must be one of `actypes' or `ibtypes'; if not, return nil." + "Return possibly new Hyperbole type symbol composed from TYPE and TYPE-CATEGORY. +TYPE and TYPE-CATEGORY are both symbols. TYPE-CATEGORY must be one of +`actypes' or `ibtypes'; if not, return nil." (when (memq type-category '(actypes ibtypes)) (intern (concat (symbol-name type-category) "::" (symbol-name type))))) @@ -304,7 +306,8 @@ TYPE-CATEGORY must be one of `actypes' or `ibtypes'; if not, return nil." (list 'execute-kbd-macro macro repeat-count)) (defun action:params-emacs (def) - "Return the argument list for the function DEF which may be a symbol or a function body." + "Return the argument list for the function DEF. +DEF may be a symbol or a function body." (let ((params (help-function-arglist def t))) (cond ((listp params) ;; includes nil params) @@ -394,7 +397,7 @@ performing ACTION." (defun actype:def-symbol (actype) "Return the abbreviated symbol for ACTYPE used in its `defact'. -ACTYPE must be a symbol or string that begins with 'actype::' or nil +ACTYPE must be a symbol or string that begins with `actype::' or nil is returned." (let ((name (if (stringp actype) actype @@ -424,7 +427,8 @@ performing ACTION." (hhist:add hist-elt)))))) (defun actype:action (actype) - "Return action part of ACTYPE (a bound function symbol, symbol name or function body). + "Return action part of ACTYPE. +ACTYPE is a bound function symbol, symbol name or function body. ACTYPE may be a Hyperbole actype or Emacs Lisp function." (let (actname action) diff --git a/hactypes.el b/hactypes.el index 3e48657192..bc15252656 100644 --- a/hactypes.el +++ b/hactypes.el @@ -75,7 +75,7 @@ Return any non-nil value or t." (or (symbol-value var) t)) (defact eval-elisp (lisp-expr) - "Evaluate a Lisp expression LISP-EXPR for its side-effects and return any non-nil value." + "Evaluate a LISP-EXPR for its side-effects and return any non-nil value." (interactive "xLisp to eval: ") (eval lisp-expr t)) @@ -212,11 +212,12 @@ kill the last output to the shell buffer before executing SHELL-CMD." (message msg))) (defact hyp-config (&optional out-buf) - "Insert Hyperbole configuration information at the end of the current buffer or within optional OUT-BUF." + "Insert Hyperbole configuration information at the end of the current buffer. +Insert in optional OUT-BUF if specified." (hypb:configuration out-buf)) (defact hyp-request (&optional out-buf) - "Insert into optional OUT-BUF a description of how to subscribe or unsubscribe from a Hyperbole mail list via email." + "Insert into optional OUT-BUF how to (un)subscribe from a Hyperbole mail list." (save-excursion (and out-buf (set-buffer out-buf)) ;; Allows for insertion prior to user's email signature @@ -282,7 +283,7 @@ This type of link is for use within a single editor session. Use (hpath:find directory)) (defact link-to-ebut (key &optional key-file) - "Perform action given by an explicit button, specified by KEY and optional KEY-FILE. + "Perform explicit button action specified by KEY and optional KEY-FILE. Interactively, KEY-FILE defaults to the current buffer's file name." (interactive (let (but-lbl @@ -476,7 +477,8 @@ suffix." (hypb:error "(link-to-Info-index-entry): Invalid Info index item: `%s'" index-item))) (defact link-to-Info-node (string) - "Display an Info node given by STRING or if not found, try to display it as an Info index item. + "Display an Info node given by STRING. +If not found, try to display it as an Info index item. STRING must be a string of the form \"(filename)name\". During button creation, completion for both filename and node names is available. Filename may be given without the .info suffix." @@ -490,7 +492,7 @@ available. Filename may be given without the .info suffix." (hypb:error "(link-to-Info-node): Invalid Info node: `%s'" string))) (defact link-to-ibut (key &optional but-src point) - "Perform an action given by an implicit button, specified by KEY, optional BUT-SRC and POINT. + "Perform implicit button action specified by KEY, optional BUT-SRC and POINT. BUT-SRC defaults to the current buffer's file or if there is no attached file, then to its buffer name. POINT defaults to the current point. diff --git a/hargs.el b/hargs.el index 305254c02f..effd499b99 100644 --- a/hargs.el +++ b/hargs.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 31-Oct-91 at 23:17:35 -;; Last-Mod: 15-Jul-22 at 22:07:35 by Mats Lidell +;; Last-Mod: 20-Jul-22 at 19:17:13 by Mats Lidell ;; ;; Copyright (C) 1991-2022 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. @@ -75,12 +75,14 @@ Convert NUL characters to colons for use with grep lines." (defun hargs:delimited (start-delim end-delim &optional start-regexp-flag end-regexp-flag list-positions-flag exclude-regexp) - "Return a normalized, single line, delimited string that point is within the first line of, or nil. + "Return a delimited string that point is within the first line of, or nil. +The string is normalized and reduced to a single line. START-DELIM and END-DELIM are strings that specify the argument delimiters. With optional START-REGEXP-FLAG non-nil, START-DELIM is treated as a regular expression. END-REGEXP-FLAG is similar. -With optional LIST-POSITIONS-FLAG, return list of (string-matched start-pos end-pos). -With optional EXCLUDE-REGEXP, any matched string is ignored if it matches this regexp." +With optional LIST-POSITIONS-FLAG, return list of (string-matched +start-pos end-pos). With optional EXCLUDE-REGEXP, any matched +string is ignored if it matches this regexp." (let* ((opoint (point)) (line-begin (line-beginning-position)) ;; This initial limit if the forward search limit for start delimiters diff --git a/hbdata.el b/hbdata.el index 4f8d694db0..b2a85c1a3d 100644 --- a/hbdata.el +++ b/hbdata.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 2-Apr-91 -;; Last-Mod: 10-May-22 at 00:24:16 by Bob Weiner +;; Last-Mod: 8-Jul-22 at 22:47:23 by Mats Lidell ;; ;; Copyright (C) 1991-2021 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. @@ -146,9 +146,10 @@ Search is case-insensitive. Return list with elements: ;;; ------------------------------------------------------------------------ (defun hbdata:build (&optional mod-lbl-key but-sym) - "Construct button data from optional MOD-LBL-KEY and BUT-SYM; modify BUT-SYM attributes. -MOD-LBL-KEY nil means create a new entry, otherwise modify existing one. -Nil BUT-SYM means use 'hbut:current'. If successful, return a cons of + "Construct button data from optional MOD-LBL-KEY and BUT-SYM. +Modify BUT-SYM attributes. MOD-LBL-KEY nil means create a new +entry, otherwise modify existing one. Nil BUT-SYM means use +'hbut:current'. If successful, return a cons of (button-data . button-instance-str), else nil." (let* ((b (hattr:copy (or but-sym 'hbut:current) 'but)) (l (hattr:get b 'loc)) @@ -222,7 +223,7 @@ Nil BUT-SYM means use 'hbut:current'. If successful, return a cons of "Return button data entry given by LBL-KEY, KEY-SRC and optional DIRECTORY. Return nil if no matching entry is found. A button data entry is a list of attribute values. Use methods from -class 'hbdata' to operate on the entry." +class `hbdata' to operate on the entry." (hbdata:apply-entry (lambda () (read (current-buffer))) lbl-key key-src directory)) @@ -253,7 +254,7 @@ Utilize arguments LBL-KEY, KEY-SRC and optional DIRECTORY." (defun hbdata:delete-entry (lbl-key key-src &optional directory) "Delete button data entry given by LBL-KEY, KEY-SRC and optional DIRECTORY. Return entry deleted (a list of attribute values) or nil. -Use methods from class 'hbdata' to operate on the entry. +Use methods from class `hbdata' to operate on the entry. If the hbdata buffer is blank/empty, kill it and remove the associated file." (hbdata:apply-entry (lambda () @@ -288,7 +289,7 @@ If the hbdata buffer is blank/empty, kill it and remove the associated file." "Return button data entry indexed by BUT-KEY, KEY-SRC, optional DIRECTORY. Return nil if entry is not found. Leave point at start of entry when successful or where entry should be inserted if unsuccessful. -A button entry is a list. Use methods from class 'hbdata' to operate on the +A button entry is a list. Use methods from class `hbdata' to operate on the entry. Optional INSTANCE non-nil means search for any button instance matching but-key." (let ((pos-entry-cons @@ -309,9 +310,10 @@ but-key." (defun hbdata:apply-entry (func lbl-key key-src &optional directory create-flag instance-flag) - "Invoke FUNC with point at hbdata entry given by LBL-KEY, KEY-SRC, optional DIRECTORY. -With optional CREATE-FLAG, if no such line exists, insert a new file entry at the -beginning of the hbdata file (which is created if necessary). + "Invoke FUNC with point at hbdata entry. +Hbdata is given by LBL-KEY, KEY-SRC and optional DIRECTORY. +With optional CREATE-FLAG, if no such line exists, insert a new file entry at +the beginning of the hbdata file (which is created if necessary). INSTANCE-FLAG non-nil means search for any button instance matching LBL-KEY and call FUNC with point right after any 'ebut:instance-sep' in match. Return value of evaluation when a matching entry is found or nil." diff --git a/hib-debbugs.el b/hib-debbugs.el index 9bfa736a4c..038348638d 100644 --- a/hib-debbugs.el +++ b/hib-debbugs.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 21-Jun-16 at 14:24:53 -;; Last-Mod: 23-Jul-22 at 19:55:32 by Bob Weiner +;; Last-Mod: 24-Jul-22 at 10:41:16 by Bob Weiner ;; ;; Copyright (C) 2016, 2021 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. @@ -96,7 +96,7 @@ ;;; ************************************************************************ (defib debbugs-gnu-query () - "Display the results of a Debbugs query based on a bug reference string around point. + "Display the results of a Debbugs query from a bug reference string around point. This works in most types of buffers. If the query includes a single id number, display the original message submission for that id and allow browsing of the followup discussion. Accepts @@ -124,7 +124,8 @@ Note that `issue' or `debbugs' may be used as well in place of `bug'." (debbugs-gnu-show-discussion))) (defun debbugs-gnu-query:help (_but) - "Make a GNU debbugs id number at point (optionally prefixed with a # sign) display the pretty pretted status of the bug id. + "Make a Gnu debbugs id number at point display the pretty-printed bug status. +The id number can optionally be prefixed with a # sign. Ignore other types of GNU debbugs query strings." (if (and (debbugs-version-sufficient-p) (debbugs-query:at-p) @@ -139,7 +140,7 @@ Ignore other types of GNU debbugs query strings." (hact 'smart-debbugs-gnu))) (defun debbugs-gnu-mode:help (&optional _but) - "Make a Gnu debbugs listing entry at point pretty print the status of the issue to a window below." + "Make a Gnu debbugs listing at point pretty-print its status to a window below." (condition-case () (let ((display-buffer-overriding-action '(display-buffer-below-selected . nil))) @@ -160,12 +161,14 @@ Ignore other types of GNU debbugs query strings." (call-interactively (key-binding "\C-m"))) (defun debbugs-gnu-query:string (url-query-string) - "Parse and apply attributes from URL-QUERY-STRING to display the results of a Gnu debbugs query. -URL-QUERY-STRING must be a valid URL query string (part after the question -mark) of debbugs attributes and values, i.e. \"attr1=val1&attr2=val2&attr3=val3\" -URL encoded characters are decoded. An optional prefix of \"bug#<id-number>?\" -may also be included at the front of the string to limit the query to a particular -issue number. Note that `issue' or `debbugs' may be used as well in place of `bug'." + "Show the results of a Gnu debbugs query with attributes from URL-QUERY-STRING. +URL-QUERY-STRING must be a valid URL query string (part after the +question mark) of debbugs attributes and values, +i.e. \"attr1=val1&attr2=val2&attr3=val3\" URL encoded characters +are decoded. An optional prefix of \"bug#<id-number>?\" may also +be included at the front of the string to limit the query to a +particular issue number. Note that `issue' or `debbugs' may be +used as well in place of `bug'." (let* ((case-fold-search t) (id (when (string-match "\\`\\(bug\\|debbugs\\|issue\\)\\s-?#?\\s-?\\(\\([1-9][0-9]*\\)\\|\\?\\)+" url-query-string) @@ -181,10 +184,10 @@ issue number. Note that `issue' or `debbugs' may be used as well in place of `b (debbugs-gnu-query:list attr-pair-list))) (defun debbugs-gnu-query:list (query-attribute-list) - "Apply attributes from QUERY-ATTRIBUTE-LIST to display the results of a Gnu debbugs query. + "Show the results of a Gnu debbugs query with QUERY-ATTRIBUTE-LIST attributes. Each element of the list should be of the form (attribute . attribute-value). -Attribute may be a symbol or a string. Common attributes include: status, -severity, and package." +Attribute may be a symbol or a string. Common attributes +include: status, severity, and package." (require 'debbugs-gnu) (setq debbugs-gnu-current-query nil) (dolist (attr query-attribute-list) @@ -196,7 +199,8 @@ severity, and package." (debbugs-gnu-show-reports)) (defun smart-debbugs-gnu () - "Display the discussion on the issue at point when the Action Key is pressed on a Gnu Debbugs listing entry ." + "Display the discussion on the issue at point. +When the Action Key is pressed on a Gnu Debbugs listing entry." (debbugs-gnu-show-discussion)) ;; (let ((entries (cdar tabulated-list-entries))) @@ -229,8 +233,9 @@ attributes." ;; (looking-at "[ \t\n\r\f]*\\(bug\\|debbugs\\|issue\\)?[ \t\n\r\f]*#\\([1-9][0-9]*\\)[\].,;?!\)\>\}]?\\([ \t\n\r\f]\\|\\'\\)") (defun debbugs-query:status (id) - "Pretty print to `standard-output' the status attributes of debbugs ID (a positive integer). -Ignore nil valued attributes. Return t unless no attributes are printed." + "Pretty print to `standard-output' the status attributes of debbugs ID. +Debbugs ID is a positive integer. Ignore nil valued attributes. +Return t unless no attributes are printed." (require 'debbugs-gnu) ;; The (car (debbugs-get-status id)) is a list of (attribute . value) pairs which we sort below. (let ((attrib-list @@ -254,7 +259,8 @@ Ignore nil valued attributes. Return t unless no attributes are printed." has-attr)))) (defun debbugs-version-sufficient-p () - "Return t iff debbugs version is sufficient for use with Hyperbole (greater than equal to 0.9.7)." + "Return t iff debbugs version is sufficient for use with Hyperbole. +Must be greater than equal to 0.9.7." (save-excursion (let* ((debbugs-src (locate-file "debbugs" load-path '(".el"))) (visiting-debbugs-src (when debbugs-src (get-file-buffer debbugs-src))) diff --git a/hmouse-tag.el b/hmouse-tag.el index 49ad105f48..89f79a240e 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -1446,7 +1446,8 @@ to look. If no tags file is found, an error is signaled." ;;; ************************************************************************ (defun smart-tags-noselect-function () - "Return the best available function for finding a tag definition without selecting it." + "Return the best available function for finding a tag definition. +The function does not select the tag definition." (car (delq nil (mapcar (lambda (func) (if (fboundp func) func)) #'(xref-definition find-tag-noselect find-tag-internal))))) diff --git a/kotl/kcell.el b/kotl/kcell.el index adb5697e22..d826ee0b00 100644 --- a/kotl/kcell.el +++ b/kotl/kcell.el @@ -59,8 +59,9 @@ not already there." plist)) (defun kcell:create-top (&optional top-cell-attributes) - "Return a new koutline top cell with optional property list of TOP-CELL-ATTRIBUTES. -The idstamp of the top cell is always 0 and this cell stores the idstamp-counter." + "Return a new top cell with optional property list of TOP-CELL-ATTRIBUTES. +The idstamp of the top cell is always 0 and this cell stores the +idstamp-counter." (kcell:create top-cell-attributes)) (defalias 'kcell:get-attr 'plist-get) @@ -73,7 +74,7 @@ The idstamp of the top cell is always 0 and this cell stores the idstamp-counter ;;;###autoload (defun kcell:ref-to-id (cell-ref &optional kviewspec-flag) - "When CELL-REF is valid, return a CELL-REF string converted to a cell idstamp (integer). + "Return a CELL-REF string converted to a cell idstamp (integer). If CELL-REF contains both a relative and a permanent id, the permanent id is returned. If CELL-REF is invalid, nil is returned. @@ -184,7 +185,7 @@ Augment capabilities not yet implemented and ignored for now: ;;; (defun kcell-data:create (cell idstamp) - "Given a kotl CELL and IDSTAMP (an integer), return a kcell-data structure to write to a file. + "Given a kotl CELL and IDSTAMP (an integer), return a kcell-data structure. If CELL, its idstamp, or its property list are nil, this repairs the cell by assuming it is the cell at point and filling in the missing information." (let ((plist (kcell:plist cell))) diff --git a/kotl/kexport.el b/kotl/kexport.el index ef4e356afa..09e095671c 100644 --- a/kotl/kexport.el +++ b/kotl/kexport.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 26-Feb-98 -;; Last-Mod: 15-Jul-22 at 23:24:27 by Mats Lidell +;; Last-Mod: 18-Jul-22 at 21:50:10 by Mats Lidell ;; ;; Copyright (C) 1998-2022 Free Software Foundation, Inc. ;; See the "../HY-COPY" file for license information. @@ -36,14 +36,15 @@ ;;; ************************************************************************ (defvar kexport:input-filename nil - "This is automatically set to the full pathname of the file presently being exported.") + "This is automatically set to the full pathname of the exported file.") (defvar kexport:output-filename nil - "This is automatically set to the full pathname of the file presently being exported.") + "This is automatically set to the full pathname of the exported file.") (defcustom kexport:html-body-attributes "BGCOLOR=\"#FFFFFF\"" ;; white background - "*String of HTML attributes attached to the <BODY> tag of an HTML exported koutline file." + "*String of HTML attributes attached to the <BODY> tag. +Part of an HTML exported koutline file." :type 'string :group 'hyperbole-koutliner) @@ -55,7 +56,8 @@ :group 'hyperbole-koutliner) (defcustom kexport:html-keywords nil - "*String of comma separated keywords to include with an HTML-exported document, or nil for none." + "*String of comma separated keywords to include with an HTML-exported document. +If nil, use no keywords." :type '(choice (const nil) (string)) :group 'hyperbole-koutliner) @@ -108,9 +110,9 @@ (cons (format "<\\s-*\\([^ \t\n\r,<>]+\\)\\s-*,\\s-*%s[^=&>]*>" kexport:kcell-partial-reference-regexp) 'kexport:html-file-klink)) - "*List of (regexp . replacement-pattern) elements applied in order to the -contents of each kcell from a koutline exported to HTML format. Replacement -pattern may be: + "*List of (regexp . replacement-pattern) elements applied in order. +The elements are applied to the contents of each kcell from a +koutline exported to HTML format. Replacement pattern may be: a string with references to regexp's grouping numbers, e.g. \\1, or a function of one argument (it is passed the string being replaced in) which returns the modified string. The function may use expressions such @@ -160,7 +162,7 @@ li { font-size: 0; } </style>\n" - "CSS that styles collapsible HTML-exported Koutline parent cells") + "CSS that styles collapsible HTML-exported Koutline parent cells.") (defconst kexport:font-awesome-css-include-with-menus "<style> @@ -294,7 +296,7 @@ menuitem > menu > menuitem.hover > menu > menuitem{ } /* End Drop-down menu CSS */ </style>\n" - "CSS that styles collapsible HTML-exported Koutline parent cells and menus") + "CSS that styles collapsible HTML-exported Koutline parent cells and menus.") (defconst kexport:font-awesome-collapsible-javascript "<script> @@ -322,7 +324,7 @@ for (i = 0; i < coll.length; i++) { }); } </script>\n" - "JavaScript which expands/collapses HTML-exported Koutline parent cells") + "JavaScript which expands/collapses HTML-exported Koutline parent cells.") ;;; ************************************************************************ ;;; Public functions @@ -330,11 +332,12 @@ for (i = 0; i < coll.length; i++) { ;;;###autoload (defun kexport:koutline (&optional soft-newlines-flag) - "Export the current buffer's koutline to the same named file with a \".html\" suffix. + "Export current buffer's koutline to the same named file with a \".html\" suffix. Return the pathname of the html file created. -By default, this retains newlines within cells as they are. With optional prefix arg, SOFT-NEWLINES-FLAG, -hard newlines are not used. Also converts Urls and Klinks into Html hyperlinks." +By default, this retains newlines within cells as they are. With +optional prefix arg, SOFT-NEWLINES-FLAG, hard newlines are not +used. Also converts Urls and Klinks into Html hyperlinks." (interactive "P") (let ((export-from buffer-file-name) (output-to (concat (file-name-sans-extension buffer-file-name) ".html"))) @@ -343,11 +346,13 @@ hard newlines are not used. Also converts Urls and Klinks into Html hyperlinks. ;;;###autoload (defun kexport:display (&optional soft-newlines-flag) - "Export the current buffer's koutline to the same named file with a \".html\" suffix and display it in a web browser. + "Export the current buffer's koutline and display it in a web browser. +The buffer is exported to the same named file with a \".html\" suffix. Return the pathname of the html file created. -By default, this retains newlines within cells as they are. With optional prefix arg, SOFT-NEWLINES-FLAG, -hard newlines are not used. Also converts Urls and Klinks into Html hyperlinks." +By default, this retains newlines within cells as they are. With +optional prefix arg, SOFT-NEWLINES-FLAG, hard newlines are not +used. Also converts Urls and Klinks into Html hyperlinks." (interactive "P") (let ((html-file (kexport:koutline soft-newlines-flag))) (hact 'www-url (concat "file://" html-file)) @@ -356,8 +361,9 @@ hard newlines are not used. Also converts Urls and Klinks into Html hyperlinks. ;;;###autoload (defun kexport:html (export-from output-to &optional soft-newlines-flag) "Export a koutline buffer or file in EXPORT-FROM to html format in OUTPUT-TO. -By default, this retains newlines within cells as they are. With optional prefix arg, SOFT-NEWLINES-FLAG, -hard newlines are not used. Also converts Urls and Klinks into Html hyperlinks. +By default, this retains newlines within cells as they are. With +optional prefix arg, SOFT-NEWLINES-FLAG, hard newlines are not +used. Also converts Urls and Klinks into Html hyperlinks. !! STILL TODO: Make delimited pathnames into file links (but not if within klinks). Copy attributes stored in cell 0 and attributes from each cell."