[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 9edb0c0 015/350: Sort out catch-all version of ebd
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 9edb0c0 015/350: Sort out catch-all version of ebdb-make-buffer-name |
Date: |
Mon, 14 Aug 2017 11:45:53 -0400 (EDT) |
branch: externals/ebdb
commit 9edb0c0a2a194e35376a5a5b673b1a8b656bf014
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Sort out catch-all version of ebdb-make-buffer-name
* ebdb-com.el (ebdb-make-buffer-name): Apparently you do it with an
empty arg list.
(ebdb-display-records): Call the method.
---
ebdb-com.el | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index f4c2cf9..73f845c 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -636,15 +636,17 @@ This happens in addition to any pre-defined indentation
of STRING."
"Return the buffer to be used by EBDB.
This examines the current major mode, and makes a decision from
-there. The result is fed to `with-current-buffer', so it's
-acceptable to return either a buffer object, or a buffer name.")
+there. The result is passed to `with-current-buffer', so a
+buffer object or a buffer name are both acceptable.")
(cl-defmethod ebdb-make-buffer-name (&context (major-mode ebdb-mode))
"If we're already in a ebdb-mode buffer, continue using that
buffer."
(current-buffer))
-(cl-defmethod ebdb-make-buffer-name (&context (major-mode _other))
+;; Apparently this is the only way to make a catch-all method with
+;; &context.
+(cl-defmethod ebdb-make-buffer-name ()
"If we're in a totally unrelated buffer, use the value of
`ebdb-buffer-name'."
(format "*%s*" ebdb-buffer-name))
@@ -652,9 +654,12 @@ buffer."
(defun ebdb-display-records (records &optional fmt append
select horiz-p buf)
"Display RECORDS using FMT.
-If APPEND is non-nil append RECORDS to the already displayed records.
-Otherwise RECORDS overwrite the displayed records.
-SELECT and HORIZ-P have the same meaning as in `ebdb-pop-up-window'."
+If APPEND is non-nil append RECORDS to the already displayed
+records. Otherwise RECORDS overwrite the displayed records.
+SELECT and HORIZ-P have the same meaning as in
+`ebdb-pop-up-window'. BUF indicates which *EBDB* buffer to use,
+or nil to generate a buffer name based on the current major
+mode."
(interactive (list (ebdb-completing-read-records "Display records: ")
(ebdb-formatter-prefix)))
(if (ebdb-append-display-p) (setq append t))
@@ -670,15 +675,7 @@ SELECT and HORIZ-P have the same meaning as in
`ebdb-pop-up-window'."
(let ((first-new (caar records))
;; `ebdb-make-buffer-name' is a generic function that
;; dispatches on the current major mode.
- (target-buffer buf))
-
- ;; This is all a huge hack until someone tells me how to override
- ;; `cl-no-applicable-method'.
- (unless target-buffer
- (condition-case nil
- (setq target-buffer (ebdb-make-buffer-name))
- (cl-no-applicable-method
- (setq target-buffer (format "*%s*" ebdb-buffer-name)))))
+ (target-buffer (or buf (ebdb-make-buffer-name))))
(with-current-buffer (get-buffer-create target-buffer)
;; If we are appending RECORDS to the ones already displayed,
- [elpa] externals/ebdb c4ea244 021/350: Add new ebdb-field-id field, (continued)
- [elpa] externals/ebdb c4ea244 021/350: Add new ebdb-field-id field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5fe2bf6 020/350: Add ebdb-field-obfuscated abstract field class, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4b8ce76 024/350: Move point to next record when adding a mark, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20f1ea2 025/350: Add command to unmark all records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9a2fd46 022/350: Merge branch 'master' into buff, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 16cdf2c 028/350: Provide protection for relations to unloaded records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 50f39b6 031/350: Forgot about rmail, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b0778d6 033/350: Make ebdb-display-records non-interactive, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1ee7829 012/350: Don't auto-save unsynced databases, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ac0b822 010/350: Switch to using kbd macro in keymap def, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9edb0c0 015/350: Sort out catch-all version of ebdb-make-buffer-name,
Eric Abrahamsen <=
- [elpa] externals/ebdb 74ed051 009/350: Better customization setup for record fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c803f1c 004/350: Forgot extra argument to ebdb-delete-i18n, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 22734d1 019/350: Select newly-cloned buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 94c7c6b 039/350: Provide ebdb-load guards in a few more places, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 015bd25 038/350: New search command ebdb-search-record-class, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f288cba 034/350: Use "d" prefix for record/database move commands, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7721bf3 044/350: Mess with autoloads, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7126d5d 027/350: Hash record uuids during the loading process, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 60aea3d 045/350: ebdb-create-record: set record class outside of interactive call, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e178321 051/350: Trailing code in last commit, Eric Abrahamsen, 2017/08/14