Skip to content
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

Hide wiki markup as part of markdown-toggle-markup-hiding #861

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

jayemar
Copy link

@jayemar jayemar commented Nov 17, 2024

When markup hiding is enabled, the markup for markdown-style links is hidden, but the markup for wiki links is not. This code change fontifies the different sections of wiki links so that they are properly supported by markdown-toggle-markup-hiding.

Related Issues

The changes address issues #557, #782, and #847.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have updated the documentation in the README.md file if necessary.
  • I have added an entry to CHANGES.md.
  • I have added tests to cover my changes.
  • All new and existing tests passed (using make test).

@syohex
Copy link
Collaborator

syohex commented Nov 18, 2024

  • Please fix all byte-compile warnings
  • Please add unit tests

@jayemar jayemar force-pushed the jayemar/toggle-hiding-of-wiki-links branch from 9a7bd6d to 4d44c6a Compare November 19, 2024 22:12
@jayemar
Copy link
Author

jayemar commented Dec 11, 2024

I fixed the byte compiler warnings and updated the wiki link tests to check that the face properties are properly being set to support markup hiding. I think I've done everything that's called out in CONTRIBUTING.md, but if not let me know.

Wiki links seemed to be handled very different front inline and reference links. I couldn't find a reason for the two different approaches, and it make some of the implementation more difficult than it needed to be, so some of my changes have the effect of treating wiki links much more like reference and inline links. If I misunderstood this and there's a reason for the two different approaches please let me know. (That's only if markdown-enable-wiki-links is t; otherwise they'll still ignored.)

@jayemar
Copy link
Author

jayemar commented Jan 28, 2025

I see this workflow is halted with the message that it is awaiting approval from a maintainer. Is there anything I can do or need to do in order to get this branch through the build pipeline?

@jayemar
Copy link
Author

jayemar commented Feb 21, 2025

@syohex fixed merge conflicts and failing tests from recent updates to mouse face in links

Copy link
Collaborator

@syohex syohex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces all of sudden. When we remove public interfaces, fist we have to set them as obsoleted function/variable. Then after several version releases, then we will be able to remove them

@@ -3394,23 +3395,6 @@ the buffer)."
(defun markdown-match-yaml-metadata-key (last)
(markdown-match-propertized-text 'markdown-metadata-key last))

(defun markdown-match-wiki-link (last)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

@@ -8451,39 +8510,6 @@ See `markdown-wiki-link-p' and `markdown-follow-wiki-link'."
(markdown-follow-wiki-link (markdown-wiki-link-link) arg)
(user-error "Point is not at a Wiki Link")))

(defun markdown-highlight-wiki-link (from to face)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

"Highlight the wiki link in the region between FROM and TO using FACE."
(put-text-property from to 'font-lock-face face))

(defun markdown-unfontify-region-wiki-links (from to)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

;; undo that if it wasn't originally marked modified
(set-buffer-modified-p modified)))

(defun markdown-fontify-region-wiki-links (from to)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

@@ -8502,50 +8528,6 @@ newline after."
(setq new-to (point)))
(cl-values new-from new-to)))

(defun markdown-check-change-for-wiki-link (from to)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

(buffer-modified-p)
(set-buffer-modified-p nil)))))

(defun markdown-check-change-for-wiki-link-after-change (from to _)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

Designed to be used with the `after-change-functions' hook."
(markdown-check-change-for-wiki-link from to))

(defun markdown-fontify-buffer-wiki-links ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

(markdown-reload-extensions))

(defun markdown-setup-wiki-link-hooks ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove public interfaces, this causes breaking backward compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants