From mboxrd@z Thu Jan 1 00:00:00 1970 From: "N. Raghavendra" Subject: Re: [PATCH] ox-html.el: Fix display of language indicators for source blocks Date: Tue, 19 Sep 2017 22:48:34 +0530 Message-ID: <877ewuehed.fsf@gmail.com> References: <8760g9ywga.fsf@hri.res.in> <87a85iparx.fsf@gmail.com> <87h8zq2sgg.fsf@nicolasgoaziou.fr> <8737bap8px.fsf@gmail.com> <87k24exyoz.fsf@gmail.com> <87tvzzecdu.fsf@gmail.com> Reply-To: "N. Raghavendra" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duMAZ-0003Eg-Qx for emacs-orgmode@gnu.org; Tue, 19 Sep 2017 13:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duMAW-00047w-4W for emacs-orgmode@gnu.org; Tue, 19 Sep 2017 13:18:47 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:38744) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duMAV-00047g-SS for emacs-orgmode@gnu.org; Tue, 19 Sep 2017 13:18:44 -0400 Received: by mail-pf0-x242.google.com with SMTP id a7so102230pfj.5 for ; Tue, 19 Sep 2017 10:18:43 -0700 (PDT) Received: from ailuros (www.hri.res.in. [220.227.103.137]) by smtp.gmail.com with ESMTPSA id e3sm6012925pga.80.2017.09.19.10.18.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 10:18:41 -0700 (PDT) In-Reply-To: <87tvzzecdu.fsf@gmail.com> (N. Raghavendra's message of "Tue, 19 Sep 2017 06:24:37 +0530") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain At 2017-09-19T06:24:37+05:30, N. Raghavendra wrote: > Attached is a patch that implements these changes. Attached is a simplified patch with an unnecessary conditional removed. Raghu. -- N. Raghavendra , http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/ --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-html.el-Partially-revert-d5bbf36553.patch >From 392d26f3c112c51661e494f4cbb0c4b30e2a8302 Mon Sep 17 00:00:00 2001 From: "N. Raghavendra" Date: Tue, 19 Sep 2017 22:37:02 +0530 Subject: [PATCH] ox-html.el: Partially revert d5bbf36553 * lisp/ox-html.el (org-html-src-block): Unless klipse is used, export source code blocks as content of `pre' elements, and not as content of `code' children of `pre' elements. Restores the previous way of exporting source code blocks, and fixes the display of language indicators while hovering over the blocks in the exported HTML file, when klipse is not used. (org-html-keep-old-src): Remove it. Not needed because it is now the default, unless klipse is used. --- lisp/ox-html.el | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index ebb233b..d91ca73 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -174,7 +174,6 @@ (:html-klipsify-src nil nil org-html-klipsify-src) (:html-klipse-css nil nil org-html-klipse-css) (:html-klipse-js nil nil org-html-klipse-js) - (:html-klipse-keep-old-src nil nil org-html-keep-old-src) (:html-klipse-selection-script nil nil org-html-klipse-selection-script) (:infojs-opt "INFOJS_OPT" nil nil) ;; Redefine regular options. @@ -1572,12 +1571,6 @@ https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag" :package-version '(Org . "9.1") :type 'string) -(defcustom org-html-keep-old-src nil - "When non-nil, use
 instead of 
."
-  :group 'org-export-html
-  :package-version '(Org . "9.1")
-  :type 'boolean)
-
 
 ;;;; Todos
 
@@ -3384,12 +3377,16 @@ contextual information."
 			      listing-number
 			      (org-trim (org-export-data caption info))))))
 		;; Contents.
-		(let ((open (if org-html-keep-old-src "" "
"))) - (format "%s class=\"src src-%s\"%s%s>%s%s" - open lang label (if (and klipsify (string= lang "html")) - " data-editor-type=\"html\"" "") - code close))))))) + (if klipsify + (format "
%s
" + lang + label + (if (string= lang "html") + " data-editor-type=\"html\"" + "") + code) + (format "
%s
" + lang label code))))))) ;;;; Statistics Cookie -- 2.7.4 --=-=-=--