From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: Emacs as a word processor (ways to convert Word/RTF proprietary files) Date: Mon, 28 Dec 2020 10:26:49 +0300 Message-ID: References: <83eejenvy2.fsf@gnu.org> <837dp6nl5e.fsf@gnu.org> <87k0t3q6qk.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14003"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Tomas Hlavaty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 28 08:41:49 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktnA5-0003Z9-Bu for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Dec 2020 08:41:49 +0100 Original-Received: from localhost ([::1]:39850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktnA4-0003Rt-DN for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Dec 2020 02:41:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktmxo-00026l-IM for emacs-devel@gnu.org; Mon, 28 Dec 2020 02:29:09 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:35037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktmxi-0000FQ-1k; Mon, 28 Dec 2020 02:29:06 -0500 Original-Received: from localhost ([::ffff:154.225.255.210]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000003C8B9.000000005FE98939.00004C6B; Mon, 28 Dec 2020 00:28:57 -0700 Mail-Followup-To: Tomas Hlavaty , Eli Zaretskii , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <87k0t3q6qk.fsf@logand.com> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261984 Archived-At: * Tomas Hlavaty [2020-12-28 00:28]: > So far I have similar limitations in emacs-pdf but I would like to > improve that. I will look into that software, I have these emails flagged as important. > > Yes, I said that it would be good to have the formula that makes > > it. The only reason to use Emacs ps-print-buffer-with-faces would be > > to print those enriched-mode notes that I have. > > When I tried enriched-mode I did not figure out how to use it. You can open any file and M-x enriched-mode, and then you may use menu Edit -> Text Properties to make background or foreground of letters, bold, italic, etc. When I mark it up as italic sadly I do not see italic on screen, that may need some set up of fonts, I cannot know. Bold italic I also do not see. And I use these keys below to quickly change those formats. (defvar hyperscope-enriched-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map enriched-mode-map) (define-key map (kbd "s-b") 'facemenu-set-bold) (define-key map (kbd "s-d") 'facemenu-set-default) (define-key map (kbd "s-i") 'facemenu-set-italic) (define-key map (kbd "s-j") 'facemenu-set-bold-italic) (define-key map (kbd "s-u") 'facemenu-set-underline) (define-key map (kbd "s-r") 'facemenu-set-background) (define-key map (kbd "s-f") 'facemenu-set-foreground) map) "The Hyperscope enriched keymap") You can also save the file and next time it is opened it will be marked up with your formats, like bold, italic, foreground and background colors. > If I implemented pdf-buffer-with-faces what kind of formatting stuff > would you find important? What is necessary is what is in the Edit -> Text properties. Also note that there can be some invisible Lisp in enriched mode, and I wish to come to that, but if anything is invisible it should not be shown on paper in my opinion. Emacs has already good printing solution. And I get easily PDF files. Now how would your solution be useful? I am using below function, so I already get the PDF converted there that remains in the directory and it also shows it in front of my face. #!/bin/bash tmpdir=/home/data1/protected/tmp/muttprint/ mkdir -p $tmpdir cd $tmpdir file=$tmpdir/$(date +'%F-%T-%A') #highlight --syntax=lisp --page-color -O pango | paps --markup --font="Monospace 11" > $file.ps cat > $file.ps #gv $file.ps # paps --font="DejaVu Sans Mono 11" > $file.ps ps2pdf14 $file.ps exec zathura $file.pdf 2> /dev/null & But printing with faces has some errors if one mixes colors with bold letters, it will not come out same in the ps/pdf files. When I find out more about errors I will report.