[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb e98b18a 06/16: New command ebdb-create-record-and-
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb e98b18a 06/16: New command ebdb-create-record-and-role |
Date: |
Sun, 16 Jun 2019 12:23:07 -0400 (EDT) |
branch: externals/ebdb
commit e98b18abd03c207e6a92ce754356e9c4d122afbb
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
New command ebdb-create-record-and-role
* ebdb-com.el (ebdb-create-record-and-role): New convenience function
for creating a new record and adding a role all at once. Really need
some way of differentiating the prompts.
* ebdb.org (Role fields): Document.
---
ebdb-com.el | 32 ++++++++++++++++++++
ebdb.info | 99 ++++++++++++++++++++++++++++++++-----------------------------
ebdb.org | 10 +++++--
ebdb.texi | 9 ++++--
4 files changed, 99 insertions(+), 51 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 40b5617..f238f4d 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -263,6 +263,7 @@ display information."
(define-key km (kbd "A") 'ebdb-mail-aliases)
(define-key km (kbd "c") 'ebdb-create-record)
(define-key km (kbd "C") 'ebdb-create-record-extended)
+ (define-key km (kbd "R") 'ebdb-create-record-and-role)
(define-key km (kbd "e") 'ebdb-edit-field)
(define-key km (kbd "E") 'ebdb-edit-field-customize)
(define-key km (kbd ";") 'ebdb-edit-foo)
@@ -1712,6 +1713,37 @@ for these values."
(ebdb-create-record db record-class)))
;;;###autoload
+(defun ebdb-create-record-and-role (rec)
+ "Convenience function for creating a record and role at once.
+If called on an organization record, create a new person record
+and give them a role at the organization. If called on a person,
+do the reverse."
+ (interactive
+ (list (ebdb-current-record)))
+ (let ((make-org (if (object-of-class-p rec 'ebdb-record-person)
+ t nil))
+ (db (car (slot-value (ebdb-record-cache rec) 'database)))
+ new-rec role-field)
+ (ebdb-create-record
+ db
+ (if make-org
+ 'ebdb-record-organization
+ 'ebdb-record-person))
+ (setq new-rec (ebdb-current-record))
+ (setq role-field (ebdb-read 'ebdb-field-role
+ `(:record-uuid
+ ,(ebdb-record-uuid
+ (if make-org rec
+ new-rec))
+ :org-uuid
+ ,(ebdb-record-uuid
+ (if make-org new-rec
+ rec)))))
+ (ebdb-with-record-edits (if make-org rec new-rec)
+ (ebdb-com-insert-field (if make-org rec new-rec)
+ role-field))))
+
+;;;###autoload
(defun ebdb-insert-field (records)
"Prompt to create a field and insert it into RECORDS.
If multiple records are marked, insert instances of the same
diff --git a/ebdb.info b/ebdb.info
index b1546aa..302c6bc 100644
--- a/ebdb.info
+++ b/ebdb.info
@@ -547,8 +547,12 @@ come up with a good interface for viewing and manipulating
these extra
fields, however, so the functionality remains hidden. Suggestions are
very welcome.
- Manipulating role fields is generally a little clunky, at present.
-This will be addressed in future.
+ It can often feel a little clunky creating a new organization to
+associate with a person, or vice versa. EBDB provides a convenience
+function to create a new person or organization record, and associate it
+with the existing record under point, in one step, using the âFâ. This
+will create a new organization if point is on a person record, or a new
+person if point is on an organization.
File: ebdb.info, Node: Tag field, Next: Mail folder field, Prev: Role
fields, Up: Field Types
@@ -2304,6 +2308,7 @@ File: ebdb.info, Node: Index, Prev: Hacking EBDB, Up:
Top
* ebdb-create-record: Creating Records. (line 6)
* ebdb-create-record <1>: The Basics of ebdb-mode.
(line 22)
+* ebdb-create-record-and-role: Role fields. (line 33)
* ebdb-create-record-extended: Creating Records. (line 14)
* ebdb-create-record-extended <1>: The Basics of ebdb-mode.
(line 26)
@@ -2578,51 +2583,51 @@ Node: Editing Existing Fields14210
Node: Deleting Records and Fields14810
Node: Field Types15206
Node: Role fields17492
-Node: Tag field19180
-Node: Mail folder field19824
-Node: MUA Interaction20152
-Node: Loading MUA Code20705
-Node: Display and Updating21418
-Node: Pop-up Buffers22184
-Node: Auto-Updating Records23927
-Node: Noticing and Automatic Rules26327
-Node: Interactive Commands27660
-Node: EBDB and MUA summary buffers30135
-Node: Sender name display30653
-Node: Summary buffer marks31880
-Node: Mail Address Completion33059
-Node: A Note on Completion35568
-Node: Specific MUAs36191
-Node: Gnus36339
-Node: Posting Styles36561
-Node: EBDB Buffers38136
-Node: Searching39347
-Node: Changing Search Behavior41009
-Node: The Basics of ebdb-mode42256
-Node: Customizing Record Display46565
-Node: Marking50885
-Node: Exporting/Formatting51312
-Node: Completion52261
-Node: Snarfing53057
-Node: Internationalization55074
-Node: Diary Integration57775
-Node: Mail Aliases58640
-Node: vCard Support59354
-Node: Org Integration59853
-Node: Citing Records61751
-Node: Hacking EBDB62509
-Node: Field Classes65100
-Node: Init and Delete Methods68236
-Node: The Labeled Field Class69743
-Node: The Singleton Field Class70597
-Node: Actions71035
-Node: Custom Field Searching71707
-Node: Fast Lookups74574
-Node: Formatting in the EBDB Buffer76384
-Node: Writing Internationalization Libraries78460
-Node: Writing Integration For New MUAs82874
-Node: Article snarfing86322
-Node: Index87040
+Node: Tag field19473
+Node: Mail folder field20117
+Node: MUA Interaction20445
+Node: Loading MUA Code20998
+Node: Display and Updating21711
+Node: Pop-up Buffers22477
+Node: Auto-Updating Records24220
+Node: Noticing and Automatic Rules26620
+Node: Interactive Commands27953
+Node: EBDB and MUA summary buffers30428
+Node: Sender name display30946
+Node: Summary buffer marks32173
+Node: Mail Address Completion33352
+Node: A Note on Completion35861
+Node: Specific MUAs36484
+Node: Gnus36632
+Node: Posting Styles36854
+Node: EBDB Buffers38429
+Node: Searching39640
+Node: Changing Search Behavior41302
+Node: The Basics of ebdb-mode42549
+Node: Customizing Record Display46858
+Node: Marking51178
+Node: Exporting/Formatting51605
+Node: Completion52554
+Node: Snarfing53350
+Node: Internationalization55367
+Node: Diary Integration58068
+Node: Mail Aliases58933
+Node: vCard Support59647
+Node: Org Integration60146
+Node: Citing Records62044
+Node: Hacking EBDB62802
+Node: Field Classes65393
+Node: Init and Delete Methods68529
+Node: The Labeled Field Class70036
+Node: The Singleton Field Class70890
+Node: Actions71328
+Node: Custom Field Searching72000
+Node: Fast Lookups74867
+Node: Formatting in the EBDB Buffer76677
+Node: Writing Internationalization Libraries78753
+Node: Writing Integration For New MUAs83167
+Node: Article snarfing86615
+Node: Index87333
End Tag Table
diff --git a/ebdb.org b/ebdb.org
index 91bb961..818cebb 100644
--- a/ebdb.org
+++ b/ebdb.org
@@ -388,8 +388,14 @@ to come up with a good interface for viewing and
manipulating these
extra fields, however, so the functionality remains hidden.
Suggestions are very welcome.
-Manipulating role fields is generally a little clunky, at present.
-This will be addressed in future.
+#+FINDEX: ebdb-create-record-and-role
+It can often feel a little clunky creating a new organization to
+associate with a person, or vice versa. EBDB provides a convenience
+function to create a new person or organization record, and associate
+it with the existing record under point, in one step, using the
+{{{kbd(F)}}}. This will create a new organization if point is on a
+person record, or a new person if point is on an organization.
+
*** Tag field
:PROPERTIES:
:ID: d9073bc7-8731-4919-9fc0-7d1dcf98426e
diff --git a/ebdb.texi b/ebdb.texi
index 960df2d..b676273 100644
--- a/ebdb.texi
+++ b/ebdb.texi
@@ -580,8 +580,13 @@ to come up with a good interface for viewing and
manipulating these
extra fields, however, so the functionality remains hidden.
Suggestions are very welcome.
-Manipulating role fields is generally a little clunky, at present.
-This will be addressed in future.
+@findex ebdb-create-record-and-role
+It can often feel a little clunky creating a new organization to
+associate with a person, or vice versa. EBDB provides a convenience
+function to create a new person or organization record, and associate
+it with the existing record under point, in one step, using the
+@kbd{F}. This will create a new organization if point is on a
+person record, or a new person if point is on an organization.
@node Tag field
@subsection Tag field
- [elpa] externals/ebdb b4e5cd4 03/16: Quit EBDB window after message is sent in mu4e, (continued)
- [elpa] externals/ebdb b4e5cd4 03/16: Quit EBDB window after message is sent in mu4e, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 480fc95 02/16: Fix functions for browsing anniversary dates, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 4a5ac62 05/16: Fix some plist-get calls to use tags, not symbols, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 688917f 04/16: Use previous object as default when editing anniversary field, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 16185b5 07/16: Fix docstring of ebdb-popup-window, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 2568b9a 10/16: Fix dumb bug in gnus and message window config, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 7a6794b 08/16: Further error with slots as keyword vs symbol, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 838103e 01/16: New option ebdb-default-window-size to control popup sizes, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 48a311a 14/16: Fix bug in popup buffer window splitting, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 1bcfaa1 12/16: Remove EBDB-Message buffer after killing or postponing message, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb e98b18a 06/16: New command ebdb-create-record-and-role,
Eric Abrahamsen <=
- [elpa] externals/ebdb 22895a4 16/16: Bump version to 0.6.9, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 7921f6a 11/16: Have ebdb-pop-up-window better honor ebdb-default-window-size, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 4e1ea30 15/16: Fix to "Remove EBDB-Message buffer after killing..." etc, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb b3dfcb8 13/16: New command ebdb-format-these-records, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 8f0251f 09/16: Give all MUAs their own version of ebdb-default-window-size, Eric Abrahamsen, 2019/06/16