Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread Norman Tovey-Walsh
> On 3 June 2020, Diego Zamboni wrote:
>> I use the config John mentioned and I like it - though I use different
>> symbols. Here's my config if you want an example:
>> https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks

This example reminded me of something that’s been puzzling me. In the
screenshot, the background color of lines that begin and end a source
block extend all the way across the screen.

When I change the faces for org block begin/end to something with a
background color, the color only extends to the end of the characters on
that line. The same is true if I change the background color of the
content of the block.

This is quite distracting. I thought “this must be the consequence of
some other mode I’m using or something” and I decided to test that. I
fired up “emacs -q” and loaded the code pointed to by the post above.
What I get is:


What’s the trick to get the background color to extend across the entire line?
<
Be seeing you,
  norm

--
Norman Tovey-Walsh 
https://nwalsh.com/

> ...it is significant that we are called the 'information society'—not
> the thinking society, not the deliberative society, not the society of
> reason and rationality.--Lloyd Morrisett


signature.asc
Description: PGP signature


Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread Joost Kremers



On Fri, Jun 19 2020, Norman Tovey-Walsh wrote:
What’s the trick to get the background color to extend across 
the entire line?


In Emacs 27, add an `:extend t` property to the face. In Emacs 26 
and earlier, IIRC, you need to make sure that the newline at the 
end of the line is also fontified. (That may actually be necessary 
in Emacs 27 as well, in addition to the `:extend` property...)


--
Joost Kremers
Life has its moments



Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread Norman Tovey-Walsh
Joost Kremers  writes:
> In Emacs 27, add an `:extend t` property to the face.

Thank you! I somehow failed to connect that with my move to Emacs 27 a
while back.

Be seeing you,
  norm

--
Norman Tovey-Walsh 
https://nwalsh.com/

> Sometimes in life situations develop that only the half-crazy can get
> out of.--La Rochefoucauld


signature.asc
Description: PGP signature


[Feature request] toggle inline image display only under current subtree

2020-06-19 Thread stardiviner


For some Org documents which has lots of images, toggle display of all inline
images will suspend Emacs, and use lot of memory. I suggest Org Mode can add an
[C-u] universal prefix detect before [C-c C-x C-v] to only display inline images
under subtree.

WDYT?

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



Re: Get Grades Done: the joys of Org's simple power

2020-06-19 Thread Richard Lawrence
Hi Devin,

Devin Prater  writes:

> Ah, I’m using Safari on MacOS 10.15. I can try with Chrome as well, though.

Did it work in Chrome, and/or when you moved the script to the end of
the file?

For what it's worth, here is a new version that should work better
regardless of where it's placed in the document.  The only change is
that the code which replaces the text representation of the checkboxes
with HTML checkboxes has been wrapped in a function that fires on the
"DOMContentLoaded" event.

Hope that's helpful!

-- 
Best,
Richard

#+begin_export html

  function updateCookiesIn(div) {
  const headline = div.querySelector("h1, h2, h3, h4, h5, h6");
  if (!headline) return;
  const cookies = Array.from(headline.querySelectorAll("code"))
.filter(c => c.innerText.startsWith("[") && 
c.innerText.endsWith("]"));
  const fracCookies = cookies.filter(c => c.innerText.includes("/"));
  const pctCookies = cookies.filter(c => c.innerText.includes("%"));

  // The ugly query strings here restrict the selection to checkboxes at 
*this* level of the hierarchy
  const allTasks = div.querySelectorAll(`#${div.id} > div > ul 
input[type=checkbox], #${div.id} > div > ol input[type=checkbox]`);
  const completedTasks = div.querySelectorAll(`#${div.id} > div > ul 
input[type=checkbox]:checked, #${div.id} > div > ol 
input[type=checkbox]:checked`);

  const newFrac = `[${completedTasks.length}/${allTasks.length}]`;
  const newPctText = allTasks.length
? (100 * completedTasks.length / allTasks.length).toFixed(0)
: "100"; // Org shows 100% for a cookie when there are no 
checkboxes 
  const newPct = `[${newPctText}%]`;

  fracCookies.forEach(c => c.innerText = newFrac);
  pctCookies.forEach(c => c.innerText = newPct);
  }

  function replaceWithCheckbox(code) {
  const isChecked = code.innerText.includes("X");

  const checkbox = document.createElement("input");
  checkbox.setAttribute("type", "checkbox");
  if (isChecked) checkbox.setAttribute("checked", "checked");
  checkbox.onclick = function (e) {
  const container = findContainingSection(e.target);
  if (!container) return;
  updateCookiesIn(container);
  };

  code.replaceWith(checkbox);
  }

  function findContainingSection(el) {
  if (!el.parentElement) return null;

  const parent = el.parentElement;
  const classes = Array.from(parent.classList);
  if (classes.some(cl => cl.startsWith("outline") && 
!cl.startsWith("outline-text"))) {
  return parent;
  } else {
  return findContainingSection(parent);
  }
  }

document.addEventListener("DOMContentLoaded", function(event) { 
  const orgCheckboxes = document.querySelectorAll(".off > code, .on > code");
  orgCheckboxes.forEach(replaceWithCheckbox);
  
  const orgSections = document.querySelectorAll("div.outline-1, div.outline-2, 
div.outline-3, div.outline-4, div.outline-5, div.outline-6");
  orgSections.forEach(updateCookiesIn);
});


#+end_export



Re: New mailing list archive at https://orgmode/list/

2020-06-19 Thread Eric Abrahamsen
Eric Wong  writes:

> Kyle Meyer  wrote:
>> Eric Abrahamsen writes:
>> 
>> > Hey, that works great! It's a bit weird that it still asks for a
>> > username and password, I wonder if there's any way to skip that. I've
>> > never dealt with anonymous IMAP before -- is there anything in the
>> > connection process that explicitly tells us "you don't need to log on"?
>> 
>> The server advertises AUTH=ANONYMOUS as a capability [*], so Gnus could
>> detect that and send "AUTHENTICATE ANONYMOUS", I _think_.
>
> Fwiw, mutt detects AUTH=ANONYMOUS and uses it automatically,
> so I think it's reasonable for Gnus and others do the same.

Looks like it would be as simple as the attached diff. I have very
little confidence in my understanding of the potential ramifications,
though, so I'll open an Emacs bug and see what other people think.

Eric

diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index f306889a7f..ebb1236674 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -837,6 +837,7 @@ gnus-registry-find-keywords
 (completing-read "Keyword: " (gnus-registry-keywords) nil t)))
   (registry-lookup-secondary-value gnus-registry-db 'keyword keyword))
 
+
 (defun gnus-registry-register-message-ids ()
   "Register the Message-ID of every article in the group."
   (unless (gnus-parameter-registry-ignore gnus-newsgroup-name)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 3c4e75ede8..18d3cba173 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -509,7 +509,8 @@ nnimap-open-connection-1
 			  (split-string capabilities)))
 	(unless (string-match-p "[*.] PREAUTH" greeting)
 	  (if (not (setq credentials
-			 (if (eq nnimap-authenticator 'anonymous)
+			 (if (or (eq nnimap-authenticator 'anonymous)
+ (nnimap-capability "AUTH=ANONYMOUS"))
  (list "anonymous"
    (message-make-address))
;; Look for the credentials based on


[FR] Add check for attachments in org-lint

2020-06-19 Thread Gustavo Barros

Hi All,

Org 'attachment:' links are essentially file links to local files and, 
while 'org-lint' checks 'file:' links for the existence of the 
corresponding files with `org-lint-link-to-local-file', as far as I can 
tell, the same check is not done for 'attachment:' links.


So, I'd like to kindly suggest that either "attachment" be included as a 
case in `org-lint-link-to-local-file' or that an equivalent check for 
attachments be included in `org-lint'.  I'd be much thankful.


Best,
Gustavo.



Re: [Manual] missing parameter documentation in the Capturing column view paragraph

2020-06-19 Thread Kyle Meyer
Paul Bonaud writes:

> In the “Capturing column view” paragraph of the Org-mode manual there is no
> mention of the `:match` parameter which was added in
> https://code.orgmode.org/bzg/org-mode/commit/8983ac917b1ca1b46697a5d27655e4ef71fa6537
>
> It would be nice to add it in the Manual of org-mode available at
> https://orgmode.org/manual/Capturing-column-view.html

Thanks for noticing.  It looks like an entry for :match was added by
Carsten in 1a978953a (2020-03-23).  That commit will be included in the
9.4 release.

> If I can contribute via a patch or git please let me know how I can do
> this. I didn't find the source code of the orgmode.org/manual in the wild.

For future reference, it's in the above repo under doc/org-manual.org.
Patches for other issues are of course very appreciated.  Information on
contributing is at .



Re: Anyone doing any fancy customizations of source blocks?

2020-06-19 Thread General discussions about Org-mode.
Hi Bill,

I'm glad you found the example useful. I've been thinking myself of also 
un-hiding the header arguments, which I do find useful to have visible.

Best,
--Diego
On Fri, Jun 19, 2020 at 4:04 AM William Denton  wrote:
“On 3 June 2020, Diego Zamboni wrote:

> I use the config John mentioned and I like it - though I use different
> symbols. Here's my config if you want an example:
> https://github.com/zzamboni/dot-emacs/blob/master/init.org#source-code-blocks

Thanks for this. I used it for a while, and it looks great, but I decided I 
want to see the details on the begin_src line all the time. I do like using the 
⎡and ⎣ character nr prettify-symbols-ali stto replace #+begin_src and 
#+end_src and will keep those.

(My apologies for weirdness in that line---the Unicode threw things off and 
I can't get it back to normal.)

I'll refer to your configuration file when I move my init files into Org. It's 
a great example.

Bill
--
William Denton :: Toronto, Canada --- Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ --- GHG.EARTH: https://ghg.earth/
Caveat lector. --- STAPLR: https://staplr.org/”


[Manual] missing parameter documentation in the Capturing column view paragraph

2020-06-19 Thread Paul Bonaud
Hello,

In the “Capturing column view” paragraph of the Org-mode manual there is no
mention of the `:match` parameter which was added in
https://code.orgmode.org/bzg/org-mode/commit/8983ac917b1ca1b46697a5d27655e4ef71fa6537

It would be nice to add it in the Manual of org-mode available at
https://orgmode.org/manual/Capturing-column-view.html

If I can contribute via a patch or git please let me know how I can do
this. I didn't find the source code of the orgmode.org/manual in the wild.

Many thanks for your help and have a nice day,
Paul B.


Re: New mailing list archive at https://orgmode/list/

2020-06-19 Thread Eric Wong
Kyle Meyer  wrote:
> Eric Abrahamsen writes:
> 
> > Hey, that works great! It's a bit weird that it still asks for a
> > username and password, I wonder if there's any way to skip that. I've
> > never dealt with anonymous IMAP before -- is there anything in the
> > connection process that explicitly tells us "you don't need to log on"?
> 
> The server advertises AUTH=ANONYMOUS as a capability [*], so Gnus could
> detect that and send "AUTHENTICATE ANONYMOUS", I _think_.

Fwiw, mutt detects AUTH=ANONYMOUS and uses it automatically,
so I think it's reasonable for Gnus and others do the same.

> [*] https://public-inbox.org/meta/20200610070519.18252-...@yhbt.net/



Org mode patch: when building sparse tree, suggest only local tags in minibuffer

2020-06-19 Thread E.L.K.
Hello.

I found that if I do "C-c C-c" on heading, it suggests only local tags in
the minibuffer, but when I do "C-m / m" (build sparse tree) it suggests
agenda tags together with local tags.

It does not make sense to build sparse tree in buffer using tags that are
not in this buffer, I think. So there is small patch in attempt to fix it.

Thanks!

I'm not subscribed, so please CC me.
Common subdirectories: /home/elk/.emacs.d/elpa/org-9.3.6/etc and /home/elk/temp/org-9.3.6/etc
diff -U 10 --color /home/elk/.emacs.d/elpa/org-9.3.6/org.el /home/elk/temp/org-9.3.6/org.el
--- /home/elk/.emacs.d/elpa/org-9.3.6/org.el	2020-06-15 19:07:22.148502633 +0300
+++ /home/elk/temp/org-9.3.6/org.el	2020-06-15 19:04:18.927678900 +0300
@@ -11924,21 +11924,21 @@
 MATCH is a string with match syntax.  It can contain a selection
 of tags (\"+work+urgent-boss\"), properties (\"LEVEL>3\"), and
 TODO keywords (\"TODO=\\\"WAITING\\\"\") or a combination of
 those.  See the manual for details.
 
 If optional argument TODO-ONLY is non-nil, only select lines that
 are also TODO tasks."
   (interactive "P")
   (org-agenda-prepare-buffers (list (current-buffer)))
   (let ((org--matcher-tags-todo-only todo-only))
-(org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match t))
+(org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match))
 		   org--matcher-tags-todo-only)))
 
 (defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
 
 (defvar org-cached-props nil)
 (defun org-cached-entry-get (pom property)
   (if (or (eq t org-use-property-inheritance)
 	  (and (stringp org-use-property-inheritance)
 	   (let ((case-fold-search t))
 		 (string-match-p org-use-property-inheritance property)))
@@ -11965,21 +11965,21 @@
 		 (set-buffer (find-file-noselect file))
 		 (org--tag-add-to-alist
 		  (org-get-buffer-tags)
 		  (mapcar (lambda (x)
 (and (stringp (car-safe x))
  (list (car-safe x
 			  org-current-tag-alist)))
 		   (if (car-safe files) files
 		 (org-agenda-files
 
-(defun org-make-tags-matcher (match  only-local-tags)
+(defun org-make-tags-matcher (match)
   "Create the TAGS/TODO matcher form for the selection string MATCH.
 
 Returns a cons of the selection string MATCH and a function
 implementing the matcher.
 
 The matcher is to be called at an Org entry, with point on the
 headline, and returns non-nil if the entry matches the selection
 string MATCH.  It must be called with three arguments: the TODO
 keyword at the entry (or nil if none), the list of all tags at
 the entry including inherited ones and the reduced level of the
@@ -11990,22 +11990,21 @@
 a non-nil value if the matcher restricts matching to TODO
 entries, otherwise it is not touched.
 
 See also `org-scan-tags'."
   (unless match
 ;; Get a new match request, with completion against the global
 ;; tags table and the local tags in current buffer.
 (let ((org-last-tags-completion-table
 	   (org--tag-add-to-alist
 	(org-get-buffer-tags)
-	(unless only-local-tags
-  (org-global-tags-completion-table)
+	(org-global-tags-completion-table
   (setq match
 	(completing-read
 	 "Match: "
 	 'org-tags-completion-function nil nil nil 'org-tags-history
 
   (let ((match0 match)
 	(re (concat
 	 "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)"
 	 "\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:-\\)*\\)+\\)"
 	 "\\([<>=]\\{1,2\\}\\)"
Binary files /home/elk/.emacs.d/elpa/org-9.3.6/org.elc and /home/elk/temp/org-9.3.6/org.elc differ