[SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope?

2022-09-10 Thread Christopher M. Miles

"Christopher M. Miles"  writes:

> [[PGP Signed Part:Undecided]]
> There is attributes setting above image link to specify image inline preview 
> size. Like this:
>
> #+begin_src org
> ,#+ATTR_ORG: :width 500
> ,#+ATTR_LATEX: :width 5.0in
> ,#+ATTR_HTML: :width 500px
> [[file:kk/88320740_p0.jpg]]
>
> #+end_src
>
> When I put it on beginning of org document, then preview inline images, but 
> those global attributes
> not affected. The inline images still display in actual image size. I want to 
> specify image size
> under headline properties. Is it possible to do this?

I implemented this feature by written a hook. Hope this can be helpful
for someone who also has this needs. Here is the code:

#+begin_src emacs-lisp
;;; auto display inline images under current TAB cycle expanded "visible" 
subtree.
(defun org-display-subtree-with-inline-images ( state)
  "Toggle the display of inline images under current expanded visible subtree.
INCLUDE-LINKED is passed to `org-display-inline-images'."
  (interactive)
  ;; (not (memq state '(overview folded contents))) ; global state change
  (let ((display-inline-images-local
 (lambda (beg end)
   (org-display-inline-images t t beg end)
   ;; display number of inline images which is intersection of two 
image overlays lists.
   ;; (message "%d images displayed inline"
   ;;  (length (cl-intersection org-inline-image-overlays 
(overlays-in beg end
   ))
(hide-inline-images-local
 (lambda ()
   (setq org-inline-image-overlays nil) ; (org-remove-inline-images)
   (message "Inline image display turned off")))
(inline-image-width-override ; get headline property value as inline 
image width.
 (lambda ()
   ;; The property "INLINE-IMAGE-WIDTH" value should be integer.
   (let* ((property-value (ignore-errors 
(org-property-or-variable-value 'INLINE-IMAGE-WIDTH)))
  (width-integer (or (and property-value
  (if (numberp property-value) 
property-value (string-to-number property-value)))
 (- (/ (window-width (selected-window) t) 
2) 100
 (setq-local org-image-actual-width width-integer)
(pcase state
  ('children
   (save-excursion
 (save-restriction
   (org-narrow-to-subtree)
   ;; If has nested headlines, beg,end only from parent headline
   ;; to first child headline which reference to upper let-binding
   ;; `org-next-visible-heading'.
   (funcall display-inline-images-local (point-min) (progn 
(org-next-visible-heading 1) (point))
  ('subtree
   (save-excursion
 (save-restriction
   (org-narrow-to-subtree)
   (funcall inline-image-width-override)
   ;; If has nested headlines, also inline display images under all 
sub-headlines.
   (funcall display-inline-images-local (point-min) (point-max)
  ('folded
   (funcall hide-inline-images-local)

(add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH")

(add-hook 'org-cycle-hook #'org-display-subtree-with-inline-images)

(define-key org-mode-map (kbd "C-c C-x C-v") 
'org-display-subtree-with-inline-images)
#+end_src

-- 

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

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


signature.asc
Description: PGP signature


[SOLVED] Re: [QUESTION] How to specific image size attributes under headline scope?

2022-09-10 Thread Christopher M. Miles

"Christopher M. Miles"  writes:

> [[PGP Signed Part:Undecided]]
> There is attributes setting above image link to specify image inline preview 
> size. Like this:
>
> #+begin_src org
> ,#+ATTR_ORG: :width 500
> ,#+ATTR_LATEX: :width 5.0in
> ,#+ATTR_HTML: :width 500px
> [[file:kk/88320740_p0.jpg]]
>
> #+end_src
>
> When I put it on beginning of org document, then preview inline images, but 
> those global attributes
> not affected. The inline images still display in actual image size. I want to 
> specify image size
> under headline properties. Is it possible to do this?

I implemented this feature by written a hook. Hope this can be helpful
for someone who also has this needs. Here is the code:

#+begin_src emacs-lisp
;;; auto display inline images under current TAB cycle expanded "visible" 
subtree.
(defun org-display-subtree-with-inline-images ( state)
  "Toggle the display of inline images under current expanded visible subtree.
INCLUDE-LINKED is passed to `org-display-inline-images'."
  (interactive)
  ;; (not (memq state '(overview folded contents))) ; global state change
  (let ((display-inline-images-local
 (lambda (beg end)
   (org-display-inline-images t t beg end)
   ;; display number of inline images which is intersection of two 
image overlays lists.
   ;; (message "%d images displayed inline"
   ;;  (length (cl-intersection org-inline-image-overlays 
(overlays-in beg end
   ))
(hide-inline-images-local
 (lambda ()
   (setq org-inline-image-overlays nil) ; (org-remove-inline-images)
   (message "Inline image display turned off")))
(inline-image-width-override ; get headline property value as inline 
image width.
 (lambda ()
   ;; The property "INLINE-IMAGE-WIDTH" value should be integer.
   (let* ((property-value (ignore-errors 
(org-property-or-variable-value 'INLINE-IMAGE-WIDTH)))
  (width-integer (or (and property-value
  (if (numberp property-value) 
property-value (string-to-number property-value)))
 (- (/ (window-width (selected-window) t) 
2) 100
 (setq-local org-image-actual-width width-integer)
(pcase state
  ('children
   (save-excursion
 (save-restriction
   (org-narrow-to-subtree)
   ;; If has nested headlines, beg,end only from parent headline
   ;; to first child headline which reference to upper let-binding
   ;; `org-next-visible-heading'.
   (funcall display-inline-images-local (point-min) (progn 
(org-next-visible-heading 1) (point))
  ('subtree
   (save-excursion
 (save-restriction
   (org-narrow-to-subtree)
   (funcall inline-image-width-override)
   ;; If has nested headlines, also inline display images under all 
sub-headlines.
   (funcall display-inline-images-local (point-min) (point-max)
  ('folded
   (funcall hide-inline-images-local)

(add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH")

(add-hook 'org-cycle-hook #'org-display-subtree-with-inline-images)

(define-key org-mode-map (kbd "C-c C-x C-v") 
'org-display-subtree-with-inline-images)
#+end_src

-- 

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

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


signature.asc
Description: PGP signature


Re: Images in org-mode

2022-09-10 Thread Mark Barton



> On Sep 10, 2022, at 12:03 PM, Colin Baxter  wrote:
> 
> 
> I seem to remember that the option
> 
> #+ATTR_ORG: :width 100
> 
> could scale the display of an image in an org-mode file. This no longer
> works - perhaps it never did. How should I scale an image display in an
> org-mode file (not exported)?
> 
> Best wishes,
> 
> Colin Baxter.
> 
> 

Check the value set for org-image-actual-width. Mine defaulted to t, so I 
changed it. There is some documentation if you use:
C-h v org-image-actual-width

Mark


Re: [PATCH] ol.el: Restore complete by description for insert link

2022-09-10 Thread Tim Cross


Max Nikulin  writes:

> On 06/09/2022 21:34, Max Nikulin wrote:
>> Does anyone have an idea why it was necessary to drop completion of stored 
>> links based
>> on their description for the sake of ido?
>
> I have no idea what is the proper way to enable ido for `org-insert-link'. 
> Functions and
> variables specific to ido were removed from Org.
> (ido-everywhere) and (ido-mode) are not enough.
>
> I tried
>
> (setq-local completing-read-function #'ido-completing-read)
>
> and the command broke completing read completely.
>
> (add-function :override completing-read-function #'ido-completing-read)
>
> inspired by `ido-everywhere' code broke M-x, but it enabled ido for 
> `org-insert-link'.
>
> I believe that descriptions as completion options were removed because ido 
> signals an
> error when nil is passed inside completion list. I consider it as a bug in 
> ido (at least
> in Emacs-27), but even when `completing-read-default' is used, it causes 
> appearance of
> undesired "nil" option. No description is a frequent case for links.
>
> So I am attaching a patch to restore completion of link targets by their 
> description, nil
> descriptions are filtered out.
>
> The change is caused by the auto-desc local variable in `org-insert-link', 
> its usage is
> rather strange and confusing currently.   Despite with this patch 
> descriptions are
> restored, I believe that logic related to auto-desc should be removed, anyway 
> it was
> broken for 10 years. I am unsure in which thread the next change should be 
> discussed.
>
>> P.S. My question is related to the following threads:
>> - Carlos Pita. Adding target and custom id links doesn't ask for 
>> description. Tue, 2 Aug
>> 2022 14:44:58
>> -0300. 
>> https://list.orgmode.org/d99a712c-18d1-4a4f-8093-35a0bfb46...@gmail.com
>> - Max Nikulin. Re: Bug: org-store-link uses CUSTOM_ID instead of target 
>> point. Sat, 6
>> Nov 2021 19:51:29
>> +0700. 
>> https://list.orgmode.org/e2c807a7-1924-6f08-9e63-4f70aee9d...@gmail.com
>
> [2. text/x-patch; 
> 0001-ol.el-Restore-complete-by-description-for-insert-lin.patch]...

You don't appear to be getting a lot of feedback on this. However, I
think it is important work your doing. I suspect the lack of feedback is
partially due to Emacs' completion infrastructure being somewhat
confusing, combined with references to ido, which I suspect is one of
the less popular completion frameworks these days. .

My take on this, which might be completely wrong, is that org-mode
should not cater for or support any specific completion
framework. Things like ido, icomplete, fido, vertico, corfu, et. al. are
something which should be supported in a generic and abstract manner
i.e. we just provide minimal necessary code to generate the candidates
these systems use. From your description, I think this is what your
doing. Perhaps the requirements might become clearer if you also tried
other completion frameworks, like fido, icomplete and vertico.

I think there has been a fair bit of work in this area in recent
versions of Emacs (i.e. Emacs 28). I also quite like packages like
vertico, corfu and embark because unlike other frameworks, they work
hard to be based on just core Emacs features/functionality and avoid
adding new libraries or re-implementing existing functionality in a new
library. THis tends to make the smaller and with better core Emacs
compatibility (main reason I don't like helm and to a lesser extent,
ivy). 



Re: Images in org-mode

2022-09-10 Thread Dominik Schrempf
Maybe there are other options, but I think the canonical way is to use the
variable `org-image-actual-width’. The help mentions some ATTR_XXX options, so
you may find more answers there!

Dominik

Colin Baxter  writes:

> I seem to remember that the option
>
> #+ATTR_ORG: :width 100
>
> could scale the display of an image in an org-mode file. This no longer
> works - perhaps it never did. How should I scale an image display in an
> org-mode file (not exported)?
>
> Best wishes,
>
> Colin Baxter.


Images in org-mode

2022-09-10 Thread Colin Baxter


I seem to remember that the option

#+ATTR_ORG: :width 100

could scale the display of an image in an org-mode file. This no longer
works - perhaps it never did. How should I scale an image display in an
org-mode file (not exported)?

Best wishes,

Colin Baxter.




Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?

2022-09-10 Thread Max Nikulin

On 10/09/2022 15:54, Ihor Radchenko wrote:

Guillaume MULLER writes:


My (unsuccessful) approaches so far to find a solution:
1. remove the automatic \begin{center} inserted by #+INCLUDE
=> using :center nil in #+INCLUDE or in additional #+ATTR_LATEX added above 
#+INCLUDE does not work
2. remove the use of \scalebox by using a more "org-mode"'s way of doing things
=> using :width in #+INCLUDE or in additional #+ATTR_LATEX or even passing 
options to dot have no effect (see previously attached file)


It is kind of late, but I think that the problem is not with Org. Rather
with LaTeX. Org uses \begin{center}..\end{center} around the image,
which cannot be used inside \scalebox. See
https://tex.stackexchange.com/questions/67843/problem-resizing-an-itemize-environment-with-a-scalebox-somethings-wrong


I have not tried to reproduce the issue, but provided latex snippet is 
quite strange. Accordingly to ORG-NEWS, \scalebox was added in 9.3 for 
tikz and pdf, while \includegraphics appeared in the example. In this 
case scale should be applied through \includegraphics option.


Anyway I expect \begin{center} around \scalebox, not inside it.

Finally it should be possible to pass :center nil through ob-dot to the 
generated image.





[PATCH] ol.el: Restore complete by description for insert link

2022-09-10 Thread Max Nikulin

On 06/09/2022 21:34, Max Nikulin wrote:


Does anyone have an idea why it was necessary to drop completion of 
stored links based on their description for the sake of ido?


I have no idea what is the proper way to enable ido for 
`org-insert-link'. Functions and variables specific to ido were removed 
from Org.

(ido-everywhere) and (ido-mode) are not enough.

I tried

(setq-local completing-read-function #'ido-completing-read)

and the command broke completing read completely.

(add-function :override completing-read-function #'ido-completing-read)

inspired by `ido-everywhere' code broke M-x, but it enabled ido for 
`org-insert-link'.


I believe that descriptions as completion options were removed because 
ido signals an error when nil is passed inside completion list. I 
consider it as a bug in ido (at least in Emacs-27), but even when 
`completing-read-default' is used, it causes appearance of undesired 
"nil" option. No description is a frequent case for links.


So I am attaching a patch to restore completion of link targets by their 
description, nil descriptions are filtered out.


The change is caused by the auto-desc local variable in 
`org-insert-link', its usage is rather strange and confusing currently. 
 Despite with this patch descriptions are restored, I believe that 
logic related to auto-desc should be removed, anyway it was broken for 
10 years. I am unsure in which thread the next change should be discussed.



P.S. My question is related to the following threads:
- Carlos Pita. Adding target and custom id links doesn't ask for 
description. Tue, 2 Aug 2022 14:44:58 -0300. 
https://list.orgmode.org/d99a712c-18d1-4a4f-8093-35a0bfb46...@gmail.com
- Max Nikulin. Re: Bug: org-store-link uses CUSTOM_ID instead of target 
point. Sat, 6 Nov 2021 19:51:29 +0700. 
https://list.orgmode.org/e2c807a7-1924-6f08-9e63-4f70aee9d...@gmail.comFrom 92e36ec13e84d2af1b367e4a3cac34288d1e8c27 Mon Sep 17 00:00:00 2001
From: Max Nikulin 
Date: Sat, 10 Sep 2022 17:23:13 +0700
Subject: [PATCH] ol.el: Restore complete by description for insert link

* lisp/ol.el (org-insert-link): Allow completion of link target by its
description.  Almost certainly the feature was removed unintentionally.

Link descriptions were added to completion options in
the commit 1e34c5d34 Bastien Guerry,  "org.el: Fontify links to current
buffer when inserting a link", 2012-08-03 14:08:20 +0200
in response to
https://list.orgmode.org/877gw6ocva@okhotsk19.lowtem.hokudai.ac.jp/T/#u
Yagnesh Raghava Yakkala, "#+LABEL and CUSTOM_ID with reftex",
Mon, 21 May 2012 04:45:29 +0900

List of description was removed from completion options
likely because `ido-completing-read' signals an error in the case of nil
variant (that is not uncommon for links with no description), see the
commit 7f096ad37 Tony Day, "org-insert-link: Use ido when inserting
links", 2012-10-12 14:39:53 +1100 and the discussion of the patch
- https://list.orgmode.org/04d0e787-a8a1-4246-8dd2-d607e38d6...@gmail.com/T/#u
  tony day.  [PATCH] * org-insert-link: use ido when inserting links.
  Fri, 12 Oct 2012 14:58:29 +1100
- https://list.orgmode.org/5ce03302-7c87-44be-b4af-a6a92c96c...@gmail.com/T/#u
  tony day.  [PATCH] org-insert-link: allow ido usage when inserting
  links.  Fri, 14 Sep 2012 19:21:50 +1000
- https://list.orgmode.org/0cada13b-8a22-4f34-91b1-2232997c1...@gmail.com/T/#u
  tony day.  [PATCH] org-insert-link: allow ido usage when inserting
  links. Fri, 12 Oct 2012 14:56:10 +1100
- https://list.orgmode.org/97f9790d-3c7f-490b-be9b-1a652bb9f...@gmail.com/
  tony day.  PATCH: using ido when inserting links.
  Fri, 14 Sep 2012 18:58:43 +1000

Since auto-desc variable added by first commit was not removed
by second one, I assume that disabling the feature was a side effect
rather than the purpose.
---
 lisp/ol.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index 7e5398b22..20b085682 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1878,7 +1878,12 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 		   "Link: "
 		   (append
 		(mapcar (lambda (x) (concat x ":")) all-prefixes)
-		(mapcar #'car org-stored-links))
+		(mapcar #'car org-stored-links)
+;; Allow description completion.  Avoid "nil" option
+;; in the case of `completing-read-default' and
+;; an error in `ido-completing-read' when some links
+;; have no description.
+(delq nil (mapcar 'cadr org-stored-links)))
 		   nil nil nil
 		   'org-link--history
 		   (caar org-stored-links)))
-- 
2.25.1



Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?

2022-09-10 Thread Ihor Radchenko
Guillaume MULLER  writes:

> My (unsuccessful) approaches so far to find a solution:
> 1. remove the automatic \begin{center} inserted by #+INCLUDE
>=> using :center nil in #+INCLUDE or in additional #+ATTR_LATEX added 
> above #+INCLUDE does not work
> 2. remove the use of \scalebox by using a more "org-mode"'s way of doing 
> things
>=> using :width in #+INCLUDE or in additional #+ATTR_LATEX or even passing 
> options to dot have no effect (see previously attached file) 

It is kind of late, but I think that the problem is not with Org. Rather
with LaTeX. Org uses \begin{center}..\end{center} around the image,
which cannot be used inside \scalebox. See
https://tex.stackexchange.com/questions/67843/problem-resizing-an-itemize-environment-with-a-scalebox-somethings-wrong
 


-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Manual Ordering and Dynamic Priority

2022-09-10 Thread Eduardo Suarez-Santana
I'd like to show some use cases as examples of long lists that I do not
consider micromanagement.

I started managing tasks with pen and paper, then Palm, Remember the Milk, and
others. None of them worked fine. I reached Org-mode because I have read about
it and it was in my try-list. It has not been an easy way, though.

Indeed, a try-list is for me an use case for org-mode. The fast pace of
technology populates my try-list too fast and I need something to manage it.
Sure, they are all optional tasks, but I don't want to review them often and
I'd like to have a predefined order to deal with them.

Another use case y when dealing with complex systems (servers and services).
There is an overload of issues and improvements to take care of. You can triage
and solve some new issues, but the others need to be captured, documented and
queued.

On Sat, Sep 10, 2022 at 08:05:34AM +1000, Tim Cross wrote:
> 
> Rudolf Adamkovič  writes:
> 
> > Tim Cross  writes:
> >
> >> - Life is about getting things done, not planning to get things
> >>   done. Overly complex management of your tasks is very likely to
> >>   result in more time spent managing the tasks than actually doing
> >>   the tasks.
> >
> > Let me share a slightly different experience.
> >
> > I used to minimize the time I spent on planning, wanting to start
> > "actually doing the tasks".  Looking back, it often led to pointless
> > work and wasted time.  So, I changed my ways!
> >
> > These days, I do not mind spending half a day, or more, on planning my
> > learning week at school.  I also do not mind "more time spent managing
> > the tasks than actually doing the tasks" because I noticed that it
> > might, unexpectedly, change the entire equation.  For example, at work,
> > I noticed that careful planning, which includes design, can save ten
> > times the time it takes, though one never knows for sure beforehand.
> >
> > For another example, I spent two days designing my Org Agenda.  I first
> > made some drawings on paper, thinking carefully about what I want from
> > it, and then configured Emacs to compute it that way.  It might sound
> > crazy, for I could have spent those two days "actually doing the tasks",
> > but I thank myself every day for doing it!
> >
> 
> The difference here is in what we define as planning. For example, I
> would not consider 2 days spend designing how my agenda would work as
> task planning - that is design work.
> 
> What I'm referring to is having a task management process where you
> spend large amounts of time just managing the item 'metadata' - not
> actually working on the item at all, but just tracking its state,
> progress, priority, etc. 
> 
> Planning as a task in itself is very important. I live by the 6Ps
> (Piss-poor planning prevents poor performance). However, that planning
> effort needs to be focused on moving things forward. Too often, I see
> people make the same error with org mode. They develop a complex all
> singing and dancing workflow for recording, tracking and managing their
> tasks. Before they realise it, they become a slave to the process and
> spend lots of time updating task state information, changing priorities
> and schedules, making notes which never get read again and tracking
> everything at a micro level. AS an extreme example, I saw someone once
> who had in their list of tasks "Get out of bed" - honestly, what is
> having that task really adding except noise and wasted time. Do you
> really need a task telling you to get out of bed? I've seen other
> examples where people find they are overwhelmed with the number of tasks
> in their task list, but when you look at what they have listed you see
> crazy micro level planning e.g.
> 
> 8:00 - Walk to bus stop
> 8:15 - Ride bus to Kent st. 
> 8:45 - Walk from Kent ST. buss stop to office
> 9:00 - Turn on office computer
> 9:00 - 11:30 - Do office work
> ...
> 
> Unless you have some sort of memory issue or learning condition,
> planning at this level is largely pointless. This may seem extreme, but
> I see people do very similar fine grained task logging in projects as
> well.
> 
> Planning, like effort estimating, is a skill and needs practice. All I
> am trying to convey is a warning against being overly ambitious or
> having overly high expectations regarding org mode and how/when it can
> be beneficial. While you can probably capture everything in your life in
> plain text org files, doing so may not actually help make your life
> easier. I believe you need to be judicious in what you map out as tasks
> and in what data you capture. Too much and there is a danger it all
> becomes white noise and you become a slave to the process. Our brains
> are amazing things which can handle a lot of complexity easily and at a
> fast rate - the interface is still faster and more powerful than org and
> we should use it to its maximum and apply org to augment it rather than
> replace it. Problem is, someone sees org mode for the first time and
> 

Re: Call code block via link?

2022-09-10 Thread Ihor Radchenko
Felix Dorner  writes:

> I have a silenced codeblock, that I postprocess to push the result (a
> password) onto the kill-ring, and then returns "Password copied" (showing
> in the status line). This works very nicely. I'm now looking for the cherry
> on the cake: I'd like to render the #+CALL as a link, e.g. something like,
> [Copy the secret thing]. Clicking/following the link would execute the call
> and my password ready to paste elsewhere. Feasible?

You can use inline babel call. See
https://orgmode.org/manual/Evaluating-Code-Blocks.html#Evaluating-Code-Blocks

If you want link specifically, see
https://github.com/yantar92/emacs-config/blob/master/config.org#src-block-links

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: #+ candidates

2022-09-10 Thread Ihor Radchenko
Perry Smith  writes:

> The manual says I can type #+ and then hit M-tab to get the list of 
> completions.  In my case, flyspell-mode had stolen that key binding so I 
> disabled flyspell-mode.
>
> There are 100 #+ candidates.  Is there a nice place that lists them and 
> documents each one?  So far, I’ve yet to find one.  It is sometimes nice to 
> browse through such a list just to become familiar with what is possible.

See [[info:org#Main Index][org#Main Index]] (search for "keyword").

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: contact management in emacs

2022-09-10 Thread Ihor Radchenko
Sébastien Rey-Coyrehourcq 
writes:

> Moving from org-contrib to https://repo.or.cz/org-contacts.git , 
> accessible with melpa,  the documentation is mostly into the source-code 
> actually, i found few example on the web .
>
> What property field are correct :MOBILE:, :PHONE:, :BIRTHDAY: , and ?

First, remember that org-contacts is built on top of generic Org
search.

org-contacts.el considers Org headline to be a contact record when it
contains any of
org-contacts-email-property
org-contacts-alias-property
org-contacts-tel-property
org-contacts-address-property
org-contacts-birthday-property

properties.

All the variables can be changed to your preference.

> I config like that (org-contacts-file (file-expand-wildcards 
> "~/my-org-roam-folder/contact/*.org.gpg))
>
> It's slow because everything need to be unencrypted before (this is 
> another problem ...) but something i don't understand is how matching 
> work :
> calling "M-x org-contacts", i try multiple patterns, so i'm interested 
> by a working org/org-roam contact example.

M-x org-contacts does a simple regexp matching across contacts.

If you want integration with org-roam, you may probably want a custom
org-roam matches equivalent to org-contacts-matcher.

There is also M-x org-contacts-completing-read

For the slowness of opening the contacts, you may consider doing
M-x profiler-start .. M-x profiler-report to see what exactly is being
slow.

> I found some alternatives to test next week :
>
> - org-vcard (on github) compatible with org-contacts, focusing on 
> import/export of vcard files
> - mu4e-contacts (on gitlab) using helm / mu4e, inspired by org-contacts
> - org-ql query ?

org-ql may be an option though it works best for a single large Org
file. You may have better luck using org-roam built-in search. I think
that the most straightforward way to integrate with org-roam would be
adding a "contact" tag to your contact records and then using the
standard org-roam search.

Hope it helps.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: Why do org-agenda-switch-to and org-agenda-goto put the point in different spots in the target buffer?

2022-09-10 Thread Ihor Radchenko
"Rohit Patnaik"  writes:

>> Recentering is purely a visual thing. It should be safe to add.
>
> I've added the recentering behavior in the attached patch. The recentering 
> part
> was more important for me than the point jumping to the heading, because
> sometimes the match would appear at the very top of the screen and I'd have to
> scroll up manually to see the heading. If the screen is centered on the match,
> then it's likely that the heading will also be visible in the window.

Note that your previous contribution was around 15LOC. To contribute
further, you need to complete the FSF copyright assignment. See
https://orgmode.org/worg/org-contribute.html#copyright
The process normally takes less than 5 working days.

> @@ -9741,6 +9741,7 @@ displayed Org file fills the frame."
>(goto-char pos)
>(when (derived-mode-p 'org-mode)
>   (org-fold-show-context 'agenda)
> +(recenter (/ (window-height) 2))

Another option could be extending org-fold-show-context-detail so that
one can set something like

((agenda . local recenter) ;; <---
 (bookmark-jump . lineage)
 (isearch . lineage)
 (default . ancestors))

It will be more flexible.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92