emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Boxquote for code in UTF-8 export
@ 2014-09-12 15:09 Sebastien Vauban
  2014-09-12 19:10 ` Nicolas Goaziou
  2014-09-12 20:36 ` Samuel Wales
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastien Vauban @ 2014-09-12 15:09 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

I'd advice to use UTF-8 characters more wildly available in the
different fonts for drawing the Boxquote around code, in function:

  ╭────
  │ (defun org-ascii--box-string (s info)
  │   "Return string S with a partial box to its left.
  │ INFO is a plist used as a communication channel."
  │   (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
  │     (format (if utf8p "╭────\n%s\n╰────" ",----\n%s\n`----")
  │ 	    (replace-regexp-in-string
  │ 	     "^" (if utf8p "│ " "| ")
  │ 	     ;; Remove last newline character.
  │ 	     (replace-regexp-in-string "\n[ \t]*\\'" "" s)))))
  ╰────

Even if it may always work in NT Emacs, thanks to font substitution, it
does not in Cygwin Emacs.

And, even with substitution, the effect may be not completely right, as
you can see on http://screencast.com/t/3P4oRqKd.

I've looked for corner characters in
- Consolas,
- Courier New,
- DejaVu Sans Mono,
- Lucida Console, and
- Lucida Sans Typewriter.

The results is that only \u250C and \u2514 are "universal" (except in
Lucida Sans Typewriter which implements almost nothing -- unlike DejaVu
Sans Mono which implements almost everything).

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Boxquote for code in UTF-8 export
  2014-09-12 15:09 Boxquote for code in UTF-8 export Sebastien Vauban
@ 2014-09-12 19:10 ` Nicolas Goaziou
  2014-09-26 10:12   ` Sebastien Vauban
  2014-09-12 20:36 ` Samuel Wales
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2014-09-12 19:10 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:

> I'd advice to use UTF-8 characters more wildly available in the
> different fonts for drawing the Boxquote around code, in function:
>
>   ╭────
>   │ (defun org-ascii--box-string (s info)
>   │   "Return string S with a partial box to its left.
>   │ INFO is a plist used as a communication channel."
>   │   (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
>   │     (format (if utf8p "╭────\n%s\n╰────" ",----\n%s\n`----")
>   │ 	    (replace-regexp-in-string
>   │ 	     "^" (if utf8p "│ " "| ")
>   │ 	     ;; Remove last newline character.
>   │ 	     (replace-regexp-in-string "\n[ \t]*\\'" "" s)))))
>   ╰────

[...]

> The results is that only \u250C and \u2514 are "universal" (except in
> Lucida Sans Typewriter which implements almost nothing -- unlike DejaVu
> Sans Mono which implements almost everything).

There are three characters required. You are only suggesting two. What
should be the third?

Anyhow, do you want to provide a patch?


Regards,

-- 
Nicolas Goaziou

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

* Re: Boxquote for code in UTF-8 export
  2014-09-12 15:09 Boxquote for code in UTF-8 export Sebastien Vauban
  2014-09-12 19:10 ` Nicolas Goaziou
@ 2014-09-12 20:36 ` Samuel Wales
  2014-09-13  8:29   ` Nicolas Goaziou
  1 sibling, 1 reply; 6+ messages in thread
From: Samuel Wales @ 2014-09-12 20:36 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

if boxquote is going to be changed, perhaps another option that would
be nice for boxquote would be to optionally not print anything to the
left of the contents?

On 9/12/14, Sebastien Vauban <sva-news@mygooglest.com> wrote:
>   ╭────
>   │ (defun org-ascii--box-string (s info)
     ^
      here

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.

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

* Re: Boxquote for code in UTF-8 export
  2014-09-12 20:36 ` Samuel Wales
@ 2014-09-13  8:29   ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2014-09-13  8:29 UTC (permalink / raw)
  To: Samuel Wales; +Cc: Sebastien Vauban, emacs-orgmode

Hello,

Samuel Wales <samologist@gmail.com> writes:

> if boxquote is going to be changed, perhaps another option that would
> be nice for boxquote would be to optionally not print anything to the
> left of the contents?
>
> On 9/12/14, Sebastien Vauban <sva-news@mygooglest.com> wrote:
>>   ╭────
>>   │ (defun org-ascii--box-string (s info)
>      ^
>       here

Providing only this option is a waste, as it's already very easy to
obtain the feature using a src-block filter.

OTOH, we could provide an option allowing to choose styles to format
source code. Offered styles could include `boxquote' (i.e. the current
one), `plain' (code only), another one looking like


  --[ language ]------------
  ...
  source code
  ...


Of course, this is only interesting if we provide at least 3-4 styles to
choose from.


Regards,

-- 
Nicolas Goaziou

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

* Re: Boxquote for code in UTF-8 export
  2014-09-12 19:10 ` Nicolas Goaziou
@ 2014-09-26 10:12   ` Sebastien Vauban
  2014-09-27 12:59     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2014-09-26 10:12 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Nicolas Goaziou wrote:
> Sebastien Vauban writes:
>
>> I'd advice to use UTF-8 characters more wildly available in the
>> different fonts for drawing the Boxquote around code, in function
>> `org-ascii--box-string'.
>>
>> The results is that only \u250C and \u2514 are "universal" (except in
>> Lucida Sans Typewriter which implements almost nothing -- unlike
>> DejaVu Sans Mono which implements almost everything).
>
> There are three characters required. You are only suggesting two.

Yes.

> What should be the third?

The third is present in (almost?) all fonts. No problem with it.

> Anyhow, do you want to provide a patch?

Here it is.

Best regards,
  Seb

* ox-ascii.el (org-ascii--box-string): Choose more universal Unicode
characters for boxquote corners.

---
 lisp/ox-ascii.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 6f2b43a..6316e59 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -542,7 +542,7 @@ Empty lines are not indented."
   "Return string S with a partial box to its left.
 INFO is a plist used as a communication channel."
   (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
-    (format (if utf8p "╭────\n%s\n╰────" ",----\n%s\n`----")
+    (format (if utf8p "┌────\n%s\n└────" ",----\n%s\n`----")
 	    (replace-regexp-in-string
 	     "^" (if utf8p "│ " "| ")
 	     ;; Remove last newline character.
-- 
2.1.1

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

* Re: Boxquote for code in UTF-8 export
  2014-09-26 10:12   ` Sebastien Vauban
@ 2014-09-27 12:59     ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2014-09-27 12:59 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:

> * ox-ascii.el (org-ascii--box-string): Choose more universal Unicode
> characters for boxquote corners.

Applied. Thank you.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2014-09-27 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 15:09 Boxquote for code in UTF-8 export Sebastien Vauban
2014-09-12 19:10 ` Nicolas Goaziou
2014-09-26 10:12   ` Sebastien Vauban
2014-09-27 12:59     ` Nicolas Goaziou
2014-09-12 20:36 ` Samuel Wales
2014-09-13  8:29   ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).