# HG changeset patch # User Pranshu Sharma # Date 1736090271 -36000 # Node ID ce527668bd7870c8da9b1094968909c702e9d648 # Parent 4af32b97ad33e6b50e4c436120268895b3e04ff1 indentation imprevoment diff -r 4af32b97ad33 -r ce527668bd78 genorg.pl --- a/genorg.pl Mon Dec 30 00:57:54 2024 +1000 +++ b/genorg.pl Mon Jan 06 01:17:51 2025 +1000 @@ -79,16 +79,16 @@ END my $elisp_code = <<"END" =~ s/\n\s+//gr; -(let ((ls '(LIST))) - (require 'org) - (mapc - (lambda (b) - (with-current-buffer b - (when (and (not (string-match "^ " (buffer-name b))) - (eq major-mode 'org-mode)) - (org-export-to-file 'html (pop ls))))) - (buffer-list)) - (kill-emacs)) + (let ((ls '(LIST))) + (require 'org) + (mapc + (lambda (b) + (with-current-buffer b + (when (and (not (string-match "^ " (buffer-name b))) + (eq major-mode 'org-mode)) + (org-export-to-file 'html (pop ls))))) + (buffer-list)) + (kill-emacs)) END @@ -173,21 +173,21 @@ my %config_vars = ( - 'emacs-path' => \$emacs, - acss => \$art_css, - ccss => \$cat_css, - indir => \$dir, - outdir => \$outdir, - no_name_dir => \$no_name_dir, - etc_files => \$etc_files, - cache => \$cache_file, - home => \$home, - about => \$about, - domain => \$domain, - title => \$blog_title, - rdesc => \$rdesc, - max_rss => \$max_rss, - max_cat => \$max_cat + 'emacs-path' => \$emacs, + acss => \$art_css, + ccss => \$cat_css, + indir => \$dir, + outdir => \$outdir, + no_name_dir => \$no_name_dir, + etc_files => \$etc_files, + cache => \$cache_file, + home => \$home, + about => \$about, + domain => \$domain, + title => \$blog_title, + rdesc => \$rdesc, + max_rss => \$max_rss, + max_cat => \$max_cat ); @@ -273,13 +273,20 @@ $changed_files{$file} = $to; push @modified_files, $rel_file; } + %changed_files // exit; + $elisp_code =~ s/LIST/join '', map "\"$_\" ", values %changed_files /e; + open my $fh, + '-|', + ($emacs, + '-Q', + '--eval', + "(progn $custom_code)", + keys %changed_files, + "--eval", + "$elisp_code"); + close $fh; + \%changed_files } - %changed_files // exit; - $elisp_code =~ s/LIST/join '', map "\"$_\" ", values %changed_files /e; - open my $fh, '-|', ($emacs, '-Q','--eval', "(progn $custom_code)", keys %changed_files, "--eval" , "$elisp_code"); - close $fh; - \%changed_files -} my $cdir; @@ -407,10 +414,10 @@ $str = "$str" if $file && ($file == $page); defined $file ? "
  • $str" : $str - } ((["←", $page - 1]) x!! ($page - 1), - @_, - (["→", $page + 1]) x ($page != $_[$#_]->[1]))) . '' - } + } ((["←", $page - 1]) x!! ($page - 1), + @_, + (["→", $page + 1]) x ($page != $_[$#_]->[1]))) . '' +} sub move_on_if_neccasary ($fh, $art_num, $total_articles, $path, $title, $rp) { return $fh if $art_num == 0 || $art_num % $max_cat;