Re: Feature request: in org html export, option to disable id & class properties.

2021-10-03 Thread Zachary Kanfer
Sure, I'm generally interested in making this useful. Weird that it claims
to be part of org, but isn't.

I do think it would be useful to have a minimalist html exporter in org,
whether slimhtml or some other one. The built-in html exporter is rather
opinionated.

On Sun, Oct 3, 2021, 11:57 AM Amin Bandali  wrote:

> Hi Zachary,
>
> Zachary Kanfer writes:
>
> > That is an interesting exporter. Is it actually part of orgmode? I don't
> > see it in the org repository. I don't want to rely on downloading
> something
> > from an archived repository that won't get bugfixes.
>
> Indeed, ox-slimhtml is not part of Org at the moment, but I'm hoping
> it can be.  I'm trying to revive discussion about it on this list,
> if you'd be interested in following and/or chiming in.
>
> --
> https://bndl.org
>


Re: Bug: invalid example for org-export-define-backend's :menu-entry argument [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]

2021-08-17 Thread Zachary Kanfer
Awesome, thank you! :)

On Sat, Aug 7, 2021 at 4:15 PM Nicolas Goaziou 
wrote:

> Hello,
>
> Zachary Kanfer  writes:
>
> > Ox.el contains the function org-export-define-backend. One of its
> > keyword arguments is :menu-entry. The examples given include
> > (https://code.orgmode.org/bzg/org-mode/src/master/lisp/ox.el#L1214)
> >
> > '(?l "Export to LaTeX"
> >  (?p "As PDF file" org-latex-export-to-pdf)
> >  (?o "As PDF file and open"
> >  (lambda (a s v b)
> >(if a (org-latex-export-to-pdf t s v b)
> >  (org-open-file
> >   (org-latex-export-to-pdf nil s v b))
> >
> > This is invalid for two reasons:
> >
> > 1. The ?p and ?o elements should be wrapped in an extra layer of
> > parentheses. For example, the ?p element should be ((?p "As PDF file"
> > org-latex-export-to-pdf)).
> > 2. There is an extra parenthesis at the end of the block.
>
> Fixed. Thank you.
>
> Regards,
> --
> Nicolas Goaziou
>


Re: Bug: invalid example for org-export-define-backend's :menu-entry argument [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]

2021-08-02 Thread Zachary Kanfer
Upon further testing, the third and fourth elements of the function should
instead be wrapped in a single set of parentheses. There should only be
three elements in the list.

On Tue, Aug 3, 2021 at 12:36 AM Zachary Kanfer  wrote:

> Ox.el contains the function org-export-define-backend. One of its
> keyword arguments is :menu-entry. The examples given include
> (https://code.orgmode.org/bzg/org-mode/src/master/lisp/ox.el#L1214)
>
> '(?l "Export to LaTeX"
>  (?p "As PDF file" org-latex-export-to-pdf)
>  (?o "As PDF file and open"
>  (lambda (a s v b)
>(if a (org-latex-export-to-pdf t s v b)
>  (org-open-file
>   (org-latex-export-to-pdf nil s v b))
>
> This is invalid for two reasons:
>
> 1. The ?p and ?o elements should be wrapped in an extra layer of
> parentheses. For example, the ?p element should be ((?p "As PDF file"
> org-latex-export-to-pdf)).
> 2. There is an extra parenthesis at the end of the block.
>
> I cannot submit a patch, as my employer currently will not sign the
> copyright assignment. I hope someone else picks this up and fixes it.
>
> 
>
>
> Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.20, cairo version 1.16.0)
>  of 2021-07-09
> Package: Org mode version 9.4.4 (release_9.4.4 @
> /usr/local/share/emacs/28.0.50/lisp/org/)
>


Bug: invalid example for org-export-define-backend's :menu-entry argument [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]

2021-08-02 Thread Zachary Kanfer
Ox.el contains the function org-export-define-backend. One of its
keyword arguments is :menu-entry. The examples given include
(https://code.orgmode.org/bzg/org-mode/src/master/lisp/ox.el#L1214)

'(?l "Export to LaTeX"
 (?p "As PDF file" org-latex-export-to-pdf)
 (?o "As PDF file and open"
 (lambda (a s v b)
   (if a (org-latex-export-to-pdf t s v b)
 (org-open-file
  (org-latex-export-to-pdf nil s v b))

This is invalid for two reasons:

1. The ?p and ?o elements should be wrapped in an extra layer of
parentheses. For example, the ?p element should be ((?p "As PDF file"
org-latex-export-to-pdf)).
2. There is an extra parenthesis at the end of the block.

I cannot submit a patch, as my employer currently will not sign the
copyright assignment. I hope someone else picks this up and fixes it.




Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.20, cairo version 1.16.0)
 of 2021-07-09
Package: Org mode version 9.4.4 (release_9.4.4 @
/usr/local/share/emacs/28.0.50/lisp/org/)


Re: Feature request: in org html export, option to disable id & class properties.

2021-07-10 Thread Zachary Kanfer
That is an interesting exporter. Is it actually part of orgmode? I don't
see it in the org repository. I don't want to rely on downloading something
from an archived repository that won't get bugfixes.

On Sat, Jul 10, 2021 at 3:41 AM András Simonyi 
wrote:

> Hello,
> I'm not really familiar with the internals of the built-in html
> exporter but the slimhtml exporter
> [https://github.com/balddotcat/ox-slimhtml]  might be closer to what
> you're looking for.
>
> best regards,
> András
>
> On Sat, 10 Jul 2021 at 09:08, Zachary Kanfer  wrote:
> >
> > When I export this sample org file:
> >
> > * top-level header
> > ** and here we have #2
> >
> > The body of the generated html has this content:
> >
> > 
> >   top-level header
> >   
> > and here we have #2
> >   
> > 
> >
> > I would prefer the html to not have these id or class properties;
> something like this:
> >
> > 
> >   top-level header
> >   
> > and here we have #2
> >   
> > 
> >
> > Actually, I'd rather skip the divs entirely, but that is a separate
> issue. Could there be a configurable way to disable the creation of these
> properties? I have searched the mailing list, and have not found anything.
> Perhaps I've missed something; there are a lot of results for "html class
> id" or similar searches. Thanks.
>


Feature request: in org html export, option to disable id & class properties.

2021-07-10 Thread Zachary Kanfer
When I export this sample org file:

* top-level header
** and here we have #2

The body of the generated html has this content:


  top-level header
  
and here we have #2
  


I would prefer the html to not have these id or class properties; something
like this:


  top-level header
  
and here we have #2
  


Actually, I'd rather skip the divs entirely, but that is a separate issue.
Could there be a configurable way to disable the creation of these
properties? I have searched the mailing list, and have not found anything.
Perhaps I've missed something; there are a lot of results for "html class
id" or similar searches. Thanks.


[O] [PATCH] org-read-date-overlay shown in other buffers, point in calendar window defaults to end of line

2012-02-07 Thread Zachary Kanfer
This patch fixes two bugs in the same section of code:

Bug 1: While running org-time-stamp, org-read-date-overlay is shown in the
current buffer, even when that buffer isn't the minibuffer. You can see
this by entering a file in org-mode, then pressing C-c . to run
org-time-stamp. The overlay is the yellow highlighted line showing the date
that will be entered into the org-mode window. For example, = 2012-01-23
Mon. Move into another window with C-x o, and the overlay is displayed
there. I don't think this is desired behavior.

To fix this, I added a line that inserts org-read-date-overlay only if the
current buffer is a minibuffer.

Bug 2: While running org-time-stamp, when moving point into the calendar
window, there is an error: error in post-command hook (buffer-read-only
*Calendar*). Additionally, point is put at the end of the line containing
the current day. To reproduce this behavior, press C-c . to run
org-time-stamp, then press C-x o repeatedly until you move point into the
window with the Calendar.

You will see the aformentioned error, and the cursor will be at the end of
the line containing the current day. To fix this, I removed the process of
explicitly saving point in the minibuffer and restoring it after inserting
org-read-date-overlay, and replaced it with save-excursion.

-Zachary Kanfer
diff --git a/lisp/org.el b/lisp/org.el
index c93b7b2..3c93dff 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15051,35 +15051,35 @@ user.
   (when org-read-date-display-live
 (when org-read-date-overlay
   (delete-overlay org-read-date-overlay))
-(let ((p (point)))
-  (end-of-line 1)
-  (while (not (equal (buffer-substring
-			  (max (point-min) (- (point) 4)) (point))
-			 ))
-	(insert  ))
-  (goto-char p))
-(let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
-			  (or org-ans1 org-ans2)))
-	   (org-end-time-was-given nil)
-	   (f (org-read-date-analyze ans def defdecode))
-	   (fmts (if org-dcst
-		 org-time-stamp-custom-formats
-		   org-time-stamp-formats))
-	   (fmt (if (or with-time
-			(and (boundp 'org-time-was-given) org-time-was-given))
-		(cdr fmts)
-		  (car fmts)))
-	   (txt (concat =  (format-time-string fmt (apply 'encode-time f)
-  (when (and org-end-time-was-given
-		 (string-match org-plain-time-of-day-regexp txt))
-	(setq txt (concat (substring txt 0 (match-end 0)) -
-			  org-end-time-was-given
-			  (substring txt (match-end 0)
-  (when org-read-date-analyze-futurep
-	(setq txt (concat txt  (=F
-  (setq org-read-date-overlay
-	(make-overlay (1- (point-at-eol)) (point-at-eol)))
-  (org-overlay-display org-read-date-overlay txt 'secondary-selection
+(when (minibufferp (current-buffer))
+  (save-excursion
+	(end-of-line 1)
+	(while (not (equal (buffer-substring
+			(max (point-min) (- (point) 4)) (point))
+			   ))
+	  (insert  )))
+  (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
+			(or org-ans1 org-ans2)))
+	 (org-end-time-was-given nil)
+	 (f (org-read-date-analyze ans def defdecode))
+	 (fmts (if org-dcst
+		   org-time-stamp-custom-formats
+		 org-time-stamp-formats))
+	 (fmt (if (or with-time
+			  (and (boundp 'org-time-was-given) org-time-was-given))
+		  (cdr fmts)
+		(car fmts)))
+	 (txt (concat =  (format-time-string fmt (apply 'encode-time f)
+	(when (and org-end-time-was-given
+		   (string-match org-plain-time-of-day-regexp txt))
+	  (setq txt (concat (substring txt 0 (match-end 0)) -
+			org-end-time-was-given
+			(substring txt (match-end 0)
+	(when org-read-date-analyze-futurep
+	  (setq txt (concat txt  (=F
+	(setq org-read-date-overlay
+	  (make-overlay (1- (point-at-eol)) (point-at-eol)))
+	(org-overlay-display org-read-date-overlay txt 'secondary-selection)
 
 (defun org-read-date-analyze (ans def defdecode)
   Analyze the combined answer of the date prompt.