From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikael Fornius Subject: Re: [PATCH] org-set/delete-property Date: Thu, 11 Mar 2010 17:43:13 +0100 Message-ID: <87zl2ekdwe.fsf_-_@eee.lan> References: <878w9zkopt.fsf@eee.lan> <874oknkoka.fsf@eee.lan> <87mxyfj9cl.fsf@eee.lan> <1B465F86-9D70-411F-93F7-E5EFE40BF0FA@gmail.com> <87iq93j6u1.fsf@eee.lan> <1783E925-8587-4FB1-A289-24C0FD7B1247@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NplZ4-0001kS-J0 for emacs-orgmode@gnu.org; Thu, 11 Mar 2010 11:48:50 -0500 Received: from [140.186.70.92] (port=41387 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NplZ3-0001Vk-Ac for emacs-orgmode@gnu.org; Thu, 11 Mar 2010 11:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NplPo-0008EL-T5 for emacs-orgmode@gnu.org; Thu, 11 Mar 2010 11:39:18 -0500 Received: from violet.abc.se ([62.80.200.155]:36487) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NplPo-0008E8-GQ for emacs-orgmode@gnu.org; Thu, 11 Mar 2010 11:39:16 -0500 In-Reply-To: <1783E925-8587-4FB1-A289-24C0FD7B1247@gmail.com> (Carsten Dominik's message of "Thu, 11 Mar 2010 15:05:03 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=initial-input.diff Content-Description: Property under cursor as INITIAL-INPUT in completing-read. 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 + * 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 + * 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 --=-=-= or always prompt (like before) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=always-prompt.diff Content-Description: Always prompt for property to operate on. (Old behavior.) 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 + * 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 + * 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) --=-=-= 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--