Re: Citation bug with print_bibliography :filter "keyword phrase" with spaces

2023-11-26 Thread András Simonyi
Dear All,

On Thu, 23 Nov 2023 at 17:54, William Denton  wrote:

> I think I've found another bug with citations, this time about filtering on
> keywords when printing bibliographies with the CSL processor.  Either that
> or I'm wrong about how it works.

Thanks for reporting, I've managed to reproduce the problem and it
turned out to be a citeproc-el bug,
which is now fixed in the master branch. The updated version should be
available in MELPA soonish.

best wishes,
András

> Here's a test .bib file; note the "keyword phrase" keywords.  Filtering 
> doesn't
> work on them.
>
> Test.bib:
>
>@article{article1,
>  title = {Title Here},
>  author = {Denton, William},
>  date = {2020-01-01},
>  journaltitle = {Journal Title},
>  issue = {1},
>  keywords = {keyword phrase}
>}
>
>@article{article2,
>  title = {Title Here Too},
>  author = {Denton, William},
>  date = {2023-11-01},
>  journaltitle = {Journal Title Too},
>  issue = {2},
>  keywords = {keyword phrase}
>}
>
>@book{book1,
>  title = {Mastering Emacs},
>  author = {Petersen, Mickey},
>  date = {2022},
>  keywords = {emacs}
>  }
>
>
> And here's an Org file.  For exporting I'm using CSL, referring to a style in 
> my
> Zotero directory.  Any Zotero user will have this, but I don't know how to 
> make
> it easily reproducible for others.
>
> ### - Org file starts
>
> #+bibliography: Test.bib
>
> #+cite_export: csl ~/Zotero/styles/chicago-author-date.csl
>
> * Text
>
> One article: [cite:@article1].  Another article: [cite:@article2].  And a 
> real book: [cite:@book1].
>
> * Everything
>
> #+print_bibliography:
>
> * Emacs
>
> #+print_bibliography: :keyword emacs
>
> * Keyword phrase
>
> #+print_bibliography: :keyword "keyword phrase"
>
> ### -- Org file ends
>
> When exported to LaTeX, the complete bibliography and the Emacs bibliography 
> are
> there, but the "keyword phrase" one isn't.  The manual says, "Values including
> spaces must be surrounded with double quotes."  I did that, but based on this 
> it
> doesn't seem to be working.
>
> (I'm running Org from the development branch.)
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
> CO₂: 421.56 ppm (Mauna Loa Observatory, 2023-11-22)



org-capture does not capture from certain pages

2023-11-26 Thread Samuel Wales
On 11/22/23, Max Nikulin  wrote:
> It seems neither the org-capture developer nor other disroot users read
> this mailing list since you did not response previous time:
>
> https://list.orgmode.org/cajcao8uxpmlmlb0mahrvjrmnzszvyzxxxvd_rppycmj9xeu...@mail.gmail.com/T/#u

ah thank you.  i haev been experiencing cognitive decline.

> Fri, 6 Oct 2023 16:43:46 -0700
>
> The following add-on is not suitable for you, but it tries to get
> metadata for web pages more aggressively:
> https://addons.mozilla.org/firefox/addon/linkremark/
> Can it get details you need when called through the toolbar icon or
> through context menu for selected text? It should open a "preview" tab
> with obtained page info.

will do when i am able to ensure i am doing it right.  hafve installed
the extension.  need to test this on disroot.

btw checking also i found that there is a url for mobile inbox view.
idk if it is going to go away like html view.  it does use js
unfortunately. so it might be a replacement for html view.  it has
intelligent horizontal space for y fonts.  low contrast unfortuately.

in /this/ view, text selection /does/ capture.  however, unfortunately
the title of the url does not includ the subject,

so a different org-capture problem.  will look at the disroot one when
i can.  and try it for this view also.

if view does not go away it will give me more time to transition to
non-google at least, if the imap idea which is a good idea is too hard
to get working for me.

# the 9... stands for 3 numbers starting with 9.  idk if privacy
issue.  tried searchjig for it and nothing came up but this works
https://mail.google.com/mail/mu/mp/9.../#tl/search/html%20view%20standard

>
>> i wonder if this is fixable?  disroot uses js.
>
> The link you posted tells that it does not use History API to set URL to
> specific message. It might use an iframe to display current message. The
> question is if it makes message subject available in page metadata.

ok

>
>> [*] html gmail is horrifyingly going away soon
>
> Try to find a mail application suitable for you (I have not tried Emacs
> built-in ones) and use IMAP to access your mail boxes.

ah good idea, like thunderbird or so i guess?  i am philosophically on
board with gnus or so but i need good mouse support and prefer running
through tor [though perhaps that is a pointless idea] and cannot do
complex configuring so i am guessing no gnus most likely.

>
>
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



replacement for poporg?

2023-11-26 Thread Samuel Wales
poporg allows you to do a c-c ' type of thing, in non-org and get an
org bufffer that you then save back to the file you ran it on.

  ;;; poporg.el --- Pop a comment or string to an empty buffer for text editing

you can do lists and tables, and then you save and you get the org
formatting that you just created in your elisp file or whatever.

however, in my emacs 27, it is making mistakes, such as grabbing from
the wrong comments in a bash function.

i have the latest package from elpa or nongnu elpa.

is there an alternative package for this package or a replacement?

thanks.

-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: Using backticks for the inline code delimiter? (now with `org-publish-all`)

2023-11-26 Thread chris
The code below is working fine as long as I stay in `org-mode`. But it shows 
its limitations when I do `M-x org-publish-all`, at which time, instead of 
having the text with style verbatim, I get the text within backticks.

Is there any improvement you could think of that would fix that?
Thanks,
Chris


On Saturday, March 19, 2022 3:17:10 AM UTC you wrote:
> > George Mauer writes:
> >> is there a straightforward way to extend the org parser to do this?
> > 
> > I don't think so. It seems the emphasis markers are hard-coded
> > in various places.
> > 
> > From a quick look at the code, you'd have to customize
> > `org-emphasis-alist` and redefine `org-set-emph-re`  and
> > `org-do-emphasis-faces`. Maybe that'd be enough.
> 
> I did just what you said, and I've inserted what's bellow, somewhere in my
> `init.org` / `init.el`, before anything `org-mode` related (save for two
> `hook`): (Note it is an almost exact copy from `org.el`, I've only changed
> a few characters. And added the `advice-add override`.)
> 
> #+begin_src emacs-lisp
>   (defun org-set-emph-re-fixed (var val)
> "Set variable and compute the emphasis regular expression."
> (set var val)
> (when (and (boundp 'org-emphasis-alist)
>(boundp 'org-emphasis-regexp-components)
>org-emphasis-alist org-emphasis-regexp-components)
>   (pcase-let*
>   ((`(,pre ,post ,border ,body ,nl) org-emphasis-regexp-components)
>(body (if (<= nl 0) body
>(format "%s*?\\(?:\n%s*?\\)\\{0,%d\\}" body body nl)))
>(template
> (format (concat "\\([%s]\\|^\\)" ;before markers
> "\\(\\([%%s]\\)\\([^%s]\\|[^%s]%s[^%s]\\)\\3\\)"
> "\\([%s]\\|$\\)") ;after markers
> pre border border body border post)))
> (setq org-emph-re (format template "*/_+"))
> (setq org-verbatim-re (format template "=~`")
> 
>   (advice-add 'org-set-emph-re :override #'org-set-emph-re-fixed)
> #+end_src
> 
> #+begin_src emacs-lisp
>   (defun org-do-emphasis-faces-fixed (limit)
> "Run through the buffer and emphasize strings."
> (let ((quick-re (format "\\([%s]\\|^\\)\\([~`=*/_+]\\)"
> (car org-emphasis-regexp-components
>   (catch :exit
> (while (re-search-forward quick-re limit t)
>   (let* ((marker (match-string 2))
>  (verbatim? (member marker '("~" "`" "="
> (when (save-excursion
> (goto-char (match-beginning 0))
> (and
>  ;; Do not match table hlines.
>  (not (and (equal marker "+")
>(org-match-line
> "[ \t]*\\(|[-+]+|?\\|\\+[-+]+\\+\\)[
> \t]*$"))) ;; Do not match headline stars.  Do not consider ;; stars of a
> headline as closing marker for bold ;; markup either.
>  (not (and (equal marker "*")
>(save-excursion
>  (forward-char)
>  (skip-chars-backward "*")
>  (looking-at-p org-outline-regexp-bol
>  ;; Match full emphasis markup regexp.
>  (looking-at (if verbatim? org-verbatim-re org-emph-re))
> ;; Do not span over paragraph boundaries.
>  (not (string-match-p org-element-paragraph-separate
>   (match-string 2)))
>  ;; Do not span over cells in table rows.
>  (not (and (save-match-data (org-match-line "[ \t]*|"))
>(string-match-p "|" (match-string 4))
>   (pcase-let ((`(,_ ,face ,_) (assoc marker org-emphasis-alist))
> (m (if org-hide-emphasis-markers 4 2)))
> (font-lock-prepend-text-property
>  (match-beginning m) (match-end m) 'face face)
> (when verbatim?
>   (org-remove-flyspell-overlays-in
>(match-beginning 0) (match-end 0))
>   (remove-text-properties (match-beginning 2) (match-end 2)
>   '(display t invisible t intangible
> t))) (add-text-properties (match-beginning 2) (match-end 2)
> '(font-lock-multiline t org-emphasis t)) (when (and
> org-hide-emphasis-markers
>(not (org-at-comment-p)))
>   (add-text-properties (match-end 4) (match-beginning 5)
>'(invisible t))
>   (add-text-properties (match-beginning 3) (match-end 3)
>'(invisible t)))
> (throw :exit t