Giter Club home page Giter Club logo

screenshot's Introduction

Screenshot.el

Ever wanted to take a screenshot of some code to share on <insert IM platform of choice here>?

  • Yes: well then this package may just be for you!
  • No: you’re lying

screenshot.png

With this package you can trivially convert a selected region of code to a screenshot (no fiddly cropping required), with nothing but Emacs itself.

If you add in xclip, this will happily copy a screenshot straight to your clipboard. Provide imagemagick too and you can get rounded borders and a drop shadow 😉.

screenshot's People

Contributors

lunik1 avatar tecosaur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

screenshot's Issues

Screenshot within C/C++ (clangd) buffer breaks lsp server (Invalid Parameters)

Taking a screenshot within a C/C++ buffer with lsp enabled (clangd) breaks the lsp server on copy/save. It does not break if the screenshot is aborted.

*Messages* reports

Screenshot copied
Error in post-command-hook (winner-save-old-configurations): (wrong-type-argument frame-live-p #<dead frame  0x56548eef4ac0>)
LSP :: Error from the Language Server: onCodeAction called for non-added file (Invalid Parameters)
LSP :: Error from the Language Server: trying to get AST for non-added document (Invalid Parameters)
LSP :: Error from the Language Server: onCodeAction called for non-added file (Invalid Parameters)
LSP :: Error from the Language Server: trying to get AST for non-added document (Invalid Parameters)

This is fixed by reverting the buffer/restarting the server.

This does not occur within a python (pyright) buffer.

I am up to date with DOOM and screenshot.el, running emacs-pgtk-native-comp.
Using clangd version 12.0.1

Edit:
Setting values such as Maximum width using -W also triggers this.

Almost working on WSL

This package looks excellent! I'm trying it out on the latest Emacs 29.3.50, built on WSL. It's not quite working, but almost! I love the high quality of the images.

Current status:

  • A screenshot taken with M-x screenshot, then save will make a screenshot of the top lines of the buffer.
  • When a region is selected, an image is created, but it's a blank image with dimensions that correspond to how many lines were in the region.

How to look for what needs to be fixed?

Image is truncated for some font sizes

I just realized that screenshots are truncated (the image height is not high enough to cover the entire text) for some font sizes. For example I have no problem with 10, but 12 is truncated.

Removing the :height attribute used in screenshot--format-text-only-buffer and screenshot--narrowed-clone-buffer fixes the problem. Of course in that case the text in the temporary buffer uses the font size of the original buffer.

I have no idea what could cause this issue, but you might have an idea :)

Screenshot taking the buffer theme for non-text only version

image
image

When I toggle -t I get this difference in behaviour. The last I used your package, I managed to get the org-mode formatting with but with the same dark background as the border.

I can't seem to identify what changed since then. Was playing around with the different flags but could not figure it out.

Also, thanks for your package! It has been helping me out with university work

Support Windows users with ShareX

Hello.

ShareX is a GPLv3 screen-shot/capture/share tool for windows.

Would you consider enabling support for this, perhaps with nested feature detecting checking window-version then executable find for sharex.exe?

I would be happy to try creating a patch for this if you might be inclined to include it.

Thanks for your work on this!

Not working on MacOS

I know that screenshot depends on x-export-frames, which I'm not sure if works in MacOS, but since there is a MacOS icon on the readme, I expect so. When running on MacOS I get the following: screenshot--process: Symbol’s function definition is void: x-export-frames

Confusion regarding transient

Hi,

I think this is a great package. However, I don't know to actually activate the transient menu. Whenever I mark a region I'm asked to specify a file name, a scheme and then afterwards I'm asked to C-c C-c in order to take a screenshot. But then I need to actually drag the mouse around the region I want to have a screenshot from. And I don't get any other options to configure.

Thanks in advance.

Support for overlays

Very cool project indeed!

It'd be great if this could support emacs overlays:

Raw picture (0 references)
image

screenshot.el
test

Also, is there any option for width size? it cropped the :require form.

Wrongly labeled config option

Hey! Great work in this package; it's a nice little quality of life improvement!

I just wanted to report what I believe is a typo (a copy-paste remnant, most likely), in the configuration: both the '-w' and '-W' options are labeled as 'minimum width', but I think the second should be 'maximum width'. The prompt and shorthand at least corroborate this and use 'Maximum width (columns)' and 'max-width' respectively.

This screenshot is of the source code, where the second block has a remaining "Minimum width" that should be "Maximum width".

two configuration options for width, min width and max width

This concerns line 405 in the source file.

Issues with screenshoting long buffers

When I screenshot org-mode buffers, it will cut off content after a certain length like so ...
image
My current workaround is quite silly, I will keep repeating the content until the screenshot expands to fit more content and crop out the rest. Example of screenshot size expanding ...
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.