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

hi-lock mode coloring would be a nice addition #32

Open
Dr-Blip opened this issue Feb 24, 2021 · 2 comments
Open

hi-lock mode coloring would be a nice addition #32

Dr-Blip opened this issue Feb 24, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Dr-Blip
Copy link

Dr-Blip commented Feb 24, 2021

With Emacs Org mode I use hi-lock-mode with a configuration section within my org file for coloring different keywords (RegExp).
It would be a nice addition if orgro would parse this section and color the current org file accordingly.

Here is a sample of the hi-lock section in an org file:

* hi-lock

;; EQUIPMENT
# hi-lock: ((" [Cc][Tt] \\|[Cc]omputed\\|[Tt]omography\\|[Mm]agnetic\\|[Rr]esonance\\| [Mm][Rr] \\| [Xx][Rr] \\| x-ray \\| [Uu][Ss] \\| nm \\| pet \\|pathology\\| mi \\| rt " (0 (quote hi-red-b) prepend)))
# hi-lock: (("surgery\\|treatment\\|genome\\|dental\\|orthodont\\| ecg \\|coherence\\|photon counting" (0 (quote hi-red-b) prepend)))
# hi-lock: (("transducer\\|optical\\|radiation\\|beam \\|pacs\\|archive\\|endoscop[ye]\\|microscop[ye]" (0 (quote hi-red-b) prepend)))
# hi-lock: (("[Oo]phthalmic\\|radiotherapy\\|ultrasound\\|magnetic\\|resonance\\| [Aa][Rr] \\| [Vv][Rr] \\|augmented\\|virtual\\|reality\\|collimator" (0 (quote hi-red-b) prepend)))

;; ALGORITHM
# Hi-lock: (("artificial\\| ai \\|neural\\|network\\| deep \\|learning\\|big data\\|analytic\\|cad\\|training\\|" (0 (quote hi-yellow) prepend)))
# Hi-lock: (("model\\| fusion\\|classification" (0 (quote hi-yellow) prepend)))
# Hi-lock: (("acquisition\\|detector\\|classify\\|render\\|enhance\\|register\\|registration\\| roi \\|region\\|interest\\|segment\\|blockchain" (0 (quote hi-yellow) prepend)))
# Hi-lock: (("monte carlo\\|scatter\\|probability\\|embed\\|3[Dd]\\|scan\\|voxel\\|pixel" (0 (quote hi-yellow) prepend)))

;; ANATOMY 
# Hi-lock: (("anatom[yi]\\|abdomen\\|blood\\|bone\\|brain\\|breast\\|eye\\|heart\\|endocrin\\|embryo\\|limb\\|vessel\\|corneal\\|oral" (0 (quote hi-green) prepend)))
# hi-lock: ((" angio\\|vascular\\|limb\\|neuro\\|lung\\|iris\\|tissue\\|hematom\\|cardi[ao]\\|coronary\\|thorax\\|lumbar\\|spine\\|prostate" (0 (quote hi-green) prepend)))
# hi-lock: ((" head\\|brain\\|nodule\\|thyroid\\|colon\\| liver\\|nerve\\|lymph\\|lesion\\|cerebral\\|cell\\|invitro\\|invivo\\|rectal\\|bladder\\|endometrial" (0 (quote hi-green) prepend)))
# Hi-lock: (("shoulder\\|knee\\|ankle\\|hip\\|wrist\\|scaphoid\\|foot\\|spinal\\|[Oo]phthalm\\|trachea\\|fetal\\|fetus\\|arthroplasty" (0 (quote hi-green) prepend)))
@amake
Copy link
Owner

amake commented Feb 24, 2021

Thanks for the request. I didn't even know hi-lock-mode existed.

It's an interesting feature, but unfortunately this would basically require me to reimplement hi-lock-mode in Dart. That's not impossible, but it's a lot of work, and it's not something I plan to take on anytime soon.

(But if I decide to make a generalized highlighting feature I will definitely keep this in mind as prior art to inform my implementation.)

@Dr-Blip
Copy link
Author

Dr-Blip commented Feb 24, 2021 via email

@amake amake added the enhancement New feature or request label Feb 25, 2021
amake added a commit that referenced this issue Oct 28, 2022
```
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
Layer OffsetEngineLayer was previously used as oldLayer.
Once a layer is used as oldLayer, it may not be used again. Instead, after calling one of the
SceneBuilder.push* methods and passing an oldLayer to it, use the layer returned by the method as
oldLayer in subsequent frames.
'dart:ui/compositing.dart':
Failed assertion: line 110 pos 9: '<optimized out>'

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack:
#2      _EngineLayerWrapper._debugCheckNotUsedAsOldLayer (dart:ui/compositing.dart:110:9)
#3      SceneBuilder.addRetained.<anonymous closure>.recursivelyCheckChildrenUsedOnce (dart:ui/compositing.dart:695:21)
#4      List.forEach (dart:core-patch/growable_array.dart:416:8)
#5      SceneBuilder.addRetained.<anonymous closure>.recursivelyCheckChildrenUsedOnce (dart:ui/compositing.dart:701:18)
#6      SceneBuilder.addRetained.<anonymous closure> (dart:ui/compositing.dart:704:7)
#7      SceneBuilder.addRetained (dart:ui/compositing.dart:707:6)
#8      Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:671:15)
#9      ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#10     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#11     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#12     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#13     ClipRectLayer.addToScene (package:flutter/src/rendering/layer.dart:1590:5)
#14     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#15     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#16     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#17     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#18     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#19     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#20     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#21     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#22     OffsetLayer.addToScene (package:flutter/src/rendering/layer.dart:1421:5)
#23     Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:674:5)
#24     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1284:13)
#25     TransformLayer.addToScene (package:flutter/src/rendering/layer.dart:1914:5)
#26     ContainerLayer.buildScene (package:flutter/src/rendering/layer.dart:1097:5)
#27     RenderView.compositeFrame (package:flutter/src/rendering/view.dart:231:37)
#28     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:514:18)
#29     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:869:13)
#30     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:375:5)
#31     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1271:15)
#32     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1200:9)
#33     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1058:5)
#34     _invoke (dart:ui/hooks.dart:145:13)
#35     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#36     _drawFrame (dart:ui/hooks.dart:112:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════════════════
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants