From: Mikael Fornius <mfo@abc.se>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-set/delete-property
Date: Thu, 11 Mar 2010 17:43:13 +0100 [thread overview]
Message-ID: <87zl2ekdwe.fsf_-_@eee.lan> (raw)
In-Reply-To: <1783E925-8587-4FB1-A289-24C0FD7B1247@gmail.com> (Carsten Dominik's message of "Thu, 11 Mar 2010 15:05:03 +0100")
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
Hmm... I realize I should have thought some more about this before
posting the original patch.
I have second thoughts:
I think the behavior to take property under cursor as the one intended
to change when editing properties feels forcing and may be confusing.
Therefore I suggest two alternatives:
make it default alternative
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Property under cursor as INITIAL-INPUT in completing-read. --]
[-- Type: text/x-patch, Size: 2372 bytes --]
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d6a0f76..425be41 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,13 @@
2010-03-11 Mikael Fornius <mfo@abc.se>
+ * org.el (org-set-property, org-delete-property)
+ (org-delete-property-globally): Suggest property at cursor as
+ initial input in completing-read instead of taking it as chosen.
+ For a more natural behavior. (Initial input does not work with
+ iswtichb.)
+
+2010-03-11 Mikael Fornius <mfo@abc.se>
+
* org.el (org-at-property-p): Check if we are inside a property
drawer not just any drawer.
(org-set-property, org-delete-property): When cursor is on a
diff --git a/lisp/org.el b/lisp/org.el
index a4932a2..0ba61fe 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12986,8 +12986,8 @@ in the current file."
(interactive
(let* ((completion-ignore-case t)
(keys (org-buffer-property-keys nil t t))
- (prop0 (or (when (org-at-property-p) (org-match-string-no-properties 2))
- (org-icompleting-read "Property: " (mapcar 'list keys))))
+ (prop0 (org-icompleting-read "Property: " (mapcar 'list keys) nil nil
+ (when (org-at-property-p) (org-match-string-no-properties 2))))
(prop (if (member prop0 keys)
prop0
(or (cdr (assoc (downcase prop0)
@@ -13014,9 +13014,8 @@ in the current file."
"In the current entry, delete PROPERTY."
(interactive
(let* ((completion-ignore-case t)
- (prop (or (when (org-at-property-p) (org-match-string-no-properties 2))
- (org-icompleting-read
- "Property: " (org-entry-properties nil 'standard)))))
+ (prop (org-icompleting-read "Property: " (org-entry-properties nil 'standard) nil nil
+ (when (org-at-property-p) (org-match-string-no-properties 2)))))
(list prop)))
(message "Property %s %s" property
(if (org-entry-delete nil property)
@@ -13027,9 +13026,9 @@ in the current file."
"Remove PROPERTY globally, from all entries."
(interactive
(let* ((completion-ignore-case t)
- (prop (org-icompleting-read
- "Globally remove property: "
- (mapcar 'list (org-buffer-property-keys)))))
+ (prop (org-icompleting-read "Globally remove property: "
+ (mapcar 'list (org-buffer-property-keys)) nil nil
+ (when (org-at-property-p) (org-match-string-no-properties 2)))))
(list prop)))
(save-excursion
(save-restriction
[-- Attachment #3: Type: text/plain, Size: 33 bytes --]
or always prompt (like before)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Always prompt for property to operate on. (Old behavior.) --]
[-- Type: text/x-patch, Size: 1555 bytes --]
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d6a0f76..4c4aac7 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
2010-03-11 Mikael Fornius <mfo@abc.se>
+ * org.el (org-set-property, org-delete-property): Reverted to old
+ behaviour: do not use property at cursor but prompt always.
+
+2010-03-11 Mikael Fornius <mfo@abc.se>
+
* org.el (org-at-property-p): Check if we are inside a property
drawer not just any drawer.
(org-set-property, org-delete-property): When cursor is on a
diff --git a/lisp/org.el b/lisp/org.el
index a4932a2..72dfa9d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12986,8 +12986,7 @@ in the current file."
(interactive
(let* ((completion-ignore-case t)
(keys (org-buffer-property-keys nil t t))
- (prop0 (or (when (org-at-property-p) (org-match-string-no-properties 2))
- (org-icompleting-read "Property: " (mapcar 'list keys))))
+ (prop0 (org-icompleting-read "Property: " (mapcar 'list keys)))
(prop (if (member prop0 keys)
prop0
(or (cdr (assoc (downcase prop0)
@@ -13014,9 +13013,7 @@ in the current file."
"In the current entry, delete PROPERTY."
(interactive
(let* ((completion-ignore-case t)
- (prop (or (when (org-at-property-p) (org-match-string-no-properties 2))
- (org-icompleting-read
- "Property: " (org-entry-properties nil 'standard)))))
+ (prop (org-icompleting-read "Property: " (org-entry-properties nil 'standard))))
(list prop)))
(message "Property %s %s" property
(if (org-entry-delete nil property)
[-- Attachment #5: Type: text/plain, Size: 185 bytes --]
For me they feels the same but I think the "always prompt" alternative
is better because it is simpler.
Simple is always good.
Sorry for spamming the change-log.
--
Mikael Fornius
[-- Attachment #6: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2010-03-11 16:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 12:49 [PATCH] org-at-property-p and related Mikael Fornius
2010-03-11 12:52 ` Mikael Fornius
2010-03-11 13:06 ` Mikael Fornius
2010-03-11 13:10 ` Carsten Dominik
2010-03-11 14:01 ` Mikael Fornius
2010-03-11 14:05 ` Carsten Dominik
2010-03-11 16:43 ` Mikael Fornius [this message]
2010-03-12 16:38 ` [PATCH] org-set/delete-property Carsten Dominik
2010-03-12 17:13 ` Mikael Fornius
2010-03-12 17:26 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zl2ekdwe.fsf_-_@eee.lan \
--to=mfo@abc.se \
--cc=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.