all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* annotate: printing the buffer/region with annotations
@ 2024-08-07 23:06 Christopher Howard
  2024-08-09 16:31 ` Michael Heerdegen
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Howard @ 2024-08-07 23:06 UTC (permalink / raw)
  To: Help Gnu Emacs Mailing List

Hi, I started using annotate package and the annotations and code look great on the screen. I was trying to figure out if there was some way to print out the code+annotations to my printer (or to a printable document) without having to take a bunch of screenshots.

Someone on IRC suggested ps-print-buffer-with-faces. This does print out in color, but it only prints the code, not the annotations.

-- 
📛 Christopher Howard
🚀 gemini://gem.librehacker.com
🌐 http://gem.librehacker.com

בראשית ברא אלהים את השמים ואת הארץ



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: annotate: printing the buffer/region with annotations
  2024-08-07 23:06 annotate: printing the buffer/region with annotations Christopher Howard
@ 2024-08-09 16:31 ` Michael Heerdegen
  2024-08-12 18:49   ` Christopher Howard
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2024-08-09 16:31 UTC (permalink / raw)
  To: Christopher Howard; +Cc: Help Gnu Emacs Mailing List

Christopher Howard <christopher@librehacker.com> writes:

> Hi, I started using annotate package and the annotations and code look
> great on the screen. I was trying to figure out if there was some way
> to print out the code+annotations to my printer (or to a printable
> document) without having to take a bunch of screenshots.
>
> Someone on IRC suggested ps-print-buffer-with-faces. This does print
> out in color, but it only prints the code, not the annotations.

It might be that there is no nice direct way using ps-printing.  I see
two possibilities:

- Export the view in text form, in some way.  Seems annotate.el
provides `annotate-integrate-annotations' - this uses the same
buffer/file though, AFAIU, so it might be a bit inconvenient.

- Use a different printing tool.  I'd try htmlize.el: just M-x
htmlize-buffer RET.  If you are lucky (didn't try) the result will
contain the annotations.  Print the html using your browser.  htmlize.el
gives good looking results most of the time.

If none of that works it would probably not be hard to create something
convenient by yourself.


Michael.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: annotate: printing the buffer/region with annotations
  2024-08-09 16:31 ` Michael Heerdegen
@ 2024-08-12 18:49   ` Christopher Howard
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Howard @ 2024-08-12 18:49 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Help Gnu Emacs Mailing List, bastibe.dev

> - Export the view in text form, in some way.  Seems annotate.el
> provides `annotate-integrate-annotations' - this uses the same
> buffer/file though, AFAIU, so it might be a bit inconvenient.
>
> - Use a different printing tool.  I'd try htmlize.el: just M-x
> htmlize-buffer RET.  If you are lucky (didn't try) the result will
> contain the annotations.  Print the html using your browser.  htmlize.el
> gives good looking results most of the time.
>
> If none of that works it would probably not be hard to create something
> convenient by yourself.
>
>
> Michael.

I tried out HTMLize. It gets me close to what I want. Unforunately, htmlize seems to be unable to properly class the annotation text, so that it is not tied by color or by css class to the corresponding underlined regions - i.e., the annotations just end up looking like part of the original source text.

I suppose I could set Annotation Position Policy to :new-line, and then use some kind of convention, where I prefix the annotation text with something like "ANNOTATION: (VARIABLE-NAME)" and then I could htmlize and get something that is readable.

I don't think annotate-integrate-annotations is useful here as the annotation gets inserted into the buffer as a language specific comment (e.g., a fortran comment when in fortran mode) and I know I don't want the annotations getting slipped into the actual code comments.

-- 
Christopher Howard



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-12 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 23:06 annotate: printing the buffer/region with annotations Christopher Howard
2024-08-09 16:31 ` Michael Heerdegen
2024-08-12 18:49   ` Christopher Howard

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.