-
Notifications
You must be signed in to change notification settings - Fork 12
Update and add hywiki tests #856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -874,20 +874,21 @@ See the Info documentation at \"(hyperbole)HyWiki\". | |
| (defun hywiki-display-referent-type (wikiword referent) | ||
| "Display WIKIWORD REFERENT, a cons of (<referent-type> . <referent-value>). | ||
| Function used to display is \"hywiki-display-<referent-type>\"." | ||
| (let* ((referent-type (car referent)) ;; a symbol | ||
| (referent-value (cdr referent)) | ||
| (display-function (intern-soft (concat "hywiki-display-" | ||
| (symbol-name referent-type))))) | ||
| (when (equal (hywiki-get-singular-wikiword wikiword) (hywiki-word-at-point)) | ||
| ;; Set referent attributes of current implicit button | ||
| (hattr:set 'hbut:current 'referent-type referent-type) | ||
| (hattr:set 'hbut:current 'referent-value referent-value)) | ||
| (cond ((fboundp display-function) | ||
| (funcall display-function wikiword referent-value)) | ||
| ((symbolp referent-type) | ||
| (error "(hywiki-display-referent-type): No hywiki-display function for referent type '%s'" referent-type)) | ||
| (t | ||
| (error "(hywiki-display-referent-type): Referent type must be a symbol, not %s" referent-type))))) | ||
| (let ((referent-type (and (consp referent) (car referent)))) | ||
| (unless (and referent-type (symbolp referent-type)) | ||
| (error "(hywiki-display-referent-type): Referent type must be a symbol, not: referent-type = %S; referent = %S" | ||
| referent referent-type)) | ||
| (let* ((referent-value (cdr referent)) | ||
| (display-function (intern-soft (concat "hywiki-display-" | ||
| (symbol-name referent-type))))) | ||
| (when (equal (hywiki-get-singular-wikiword wikiword) (hywiki-word-at-point)) | ||
| ;; Set referent attributes of current implicit button | ||
| (hattr:set 'hbut:current 'referent-type referent-type) | ||
| (hattr:set 'hbut:current 'referent-value referent-value)) | ||
| (cond ((fboundp display-function) | ||
| (funcall display-function wikiword referent-value)) | ||
| (t | ||
| (error "(hywiki-display-referent-type): No hywiki-display function for referent type '%s'" referent-type)))))) | ||
|
|
||
| (defun hywiki-display-referent (&optional wikiword prompt-flag) | ||
| "Display HyWiki WIKIWORD referent or a regular file with WIKIWORD nil. | ||
|
|
@@ -1318,11 +1319,11 @@ with the page." | |
| (unless (stringp wikiword) | ||
| (setq wikiword (hywiki-word-read-new "Create/Edit HyWikiWord: "))) | ||
| (setq hkey-value wikiword) | ||
| (let ((page-file (hywiki-add-page wikiword t))) | ||
| (let ((page-file (cdr (hywiki-add-page wikiword t)))) | ||
| (if (or message-flag (called-interactively-p 'interactive)) | ||
| (when page-file | ||
| (message "HyWikiWord '%s' page: \"%s\"" wikiword page-file)) | ||
| (user-error "(hywiki-create-page): Invalid HyWikiWord: '%s'; must be capitalized, all alpha" wikiword)) | ||
| (if page-file | ||
| (message "HyWikiWord '%s' page: \"%s\"" wikiword page-file) | ||
| (user-error "(hywiki-create-page): Invalid HyWikiWord: '%s'; must be capitalized, all alpha" wikiword))) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Formatting looks strange in the diff here. I think it is due to space and tabs. Maybe we should look over our code style to ensure we use the same whitespace conventions to make the diffs easier to read.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree; it is annoying. I allow for tabs right now and use default wmacs tab soacing, I believe. |
||
| page-file)) | ||
|
|
||
| (defun hywiki-add-page (page-name &optional force-flag) | ||
|
|
@@ -1400,8 +1401,7 @@ referent." | |
| "referent" | ||
| "page")))) | ||
| current-prefix-arg)) | ||
| (if (or (and hywiki-referent-prompt-flag (null arg)) | ||
| arg) | ||
| (if (or arg hywiki-referent-prompt-flag) | ||
| (hywiki-create-referent wikiword t) | ||
| (hywiki-create-page wikiword t))) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can't be reached since symbol-name on line 880 will raise an error.