Skip to content

Commit 59124e8

Browse files
committed
Update patches
1 parent 18c621b commit 59124e8

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed

init.el

+11-10
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ Accepts keyword arguments:
577577
key in the repeat map, but will not set the
578578
`repeat-map' property of the bound command.
579579
:continue BINDINGS - Within the scope of `:repeat-map' forces the
580-
same behaviour as if no special keyword had
580+
same behavior as if no special keyword had
581581
been used (that is, the command is bound, and
582582
it's `repeat-map' property set)
583583
:filter FORM - optional form to determine when bindings apply
@@ -1823,7 +1823,7 @@ and the last `isearch-string' is added to the future history."
18231823
;; this a setting.
18241824

18251825
(el-patch-defvar consult--source-project-buffer
1826-
`(:name "Project Buffer"
1826+
`( :name "Project Buffer"
18271827
:narrow ?b
18281828
:category buffer
18291829
:face consult-buffer
@@ -1833,15 +1833,16 @@ and the last `isearch-string' is added to the future history."
18331833
:items
18341834
,(lambda ()
18351835
(when-let (root (consult--project-root))
1836-
(consult--buffer-query :sort (el-patch-swap 'visibility 'current-last)
1836+
(consult--buffer-query :sort (el-patch-swap 'visibility
1837+
'current-last)
18371838
:directory root
18381839
:as #'consult--buffer-pair))))
1839-
"Project buffer candidate source for `consult-buffer'.")
1840+
"Project buffer source for `consult-buffer'.")
18401841

18411842
(el-patch-validate 'consult--source-project-buffer 'defvar t)
18421843

18431844
(el-patch-defvar consult--source-hidden-buffer
1844-
`(:name "Hidden Buffer"
1845+
`( :name "Hidden Buffer"
18451846
:narrow ?\s
18461847
:hidden t
18471848
:category buffer
@@ -1853,12 +1854,12 @@ and the last `isearch-string' is added to the future history."
18531854
'current-last)
18541855
:filter 'invert
18551856
:as #'consult--buffer-pair)))
1856-
"Hidden buffer candidate source for `consult-buffer'.")
1857+
"Hidden buffer source for `consult-buffer'.")
18571858

18581859
(el-patch-validate 'consult--source-hidden-buffer 'defvar t)
18591860

18601861
(el-patch-defvar consult--source-modified-buffer
1861-
`(:name "Modified Buffer"
1862+
`( :name "Modified Buffer"
18621863
:narrow ?*
18631864
:hidden t
18641865
:category buffer
@@ -1873,12 +1874,12 @@ and the last `isearch-string' is added to the future history."
18731874
(lambda (buf)
18741875
(and (buffer-modified-p buf)
18751876
(buffer-file-name buf))))))
1876-
"Modified buffer candidate source for `consult-buffer'.")
1877+
"Modified buffer source for `consult-buffer'.")
18771878

18781879
(el-patch-validate 'consult--source-modified-buffer 'defvar t)
18791880

18801881
(el-patch-defvar consult--source-buffer
1881-
`(:name "Buffer"
1882+
`( :name "Buffer"
18821883
:narrow ?b
18831884
:category buffer
18841885
:face consult-buffer
@@ -1889,7 +1890,7 @@ and the last `isearch-string' is added to the future history."
18891890
,(lambda () (consult--buffer-query :sort (el-patch-swap 'visibility
18901891
'current-last)
18911892
:as #'consult--buffer-pair)))
1892-
"Buffer candidate source for `consult-buffer'.")
1893+
"Buffer source for `consult-buffer'.")
18931894

18941895
(el-patch-validate 'consult--source-buffer 'defvar t))
18951896

recipes/el-patch-dont-kill-my-buffers.el

+20-14
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,21 @@
3434
Visit the library in a buffer, and return a cons cell (BUFFER . POSITION),
3535
or just (BUFFER . nil) if the definition can't be found in the file.
3636
37-
If TYPE is nil, look for a function definition.
38-
Otherwise, TYPE specifies the kind of definition,
39-
and it is interpreted via `find-function-regexp-alist'.
37+
If TYPE is nil, look for a function definition,
38+
otherwise, TYPE specifies the kind of definition.
39+
If SYMBOL has a property `definition-type',
40+
the property value is used instead of TYPE.
41+
TYPE is interpreted via `find-function-regexp-alist'.
42+
4043
The search is done in the source for library LIBRARY."
4144
(if (null library)
4245
(error "Don't know where `%s' is defined" symbol))
4346
;; Some functions are defined as part of the construct
4447
;; that defines something else.
4548
(while (and (symbolp symbol) (get symbol 'definition-name))
4649
(setq symbol (get symbol 'definition-name)))
50+
(setq type (or (get symbol 'definition-type)
51+
type))
4752
(if (string-match "\\`src/\\(.*\\.\\(c\\|m\\)\\)\\'" library)
4853
(find-function-C-source symbol (match-string 1 library) type)
4954
(when (string-match "\\.el\\(c\\)\\'" library)
@@ -53,17 +58,17 @@ The search is done in the source for library LIBRARY."
5358
(when (string-match "\\.emacs\\(.el\\)\\'" library)
5459
(setq library (substring library 0 (match-beginning 1))))
5560
(let* ((filename (find-library-name library))
56-
(regexp-symbol (cdr (assq type find-function-regexp-alist))))
61+
(regexp-symbol (cdr (assq type find-function-regexp-alist))))
5762
(with-current-buffer (find-file-noselect filename)
58-
(let ((regexp (if (functionp regexp-symbol) regexp-symbol
63+
(let ((regexp (if (functionp regexp-symbol) regexp-symbol
5964
(format (symbol-value regexp-symbol)
6065
;; Entry for ` (backquote) macro in loaddefs.el,
6166
;; (defalias (quote \`)..., has a \ but
6267
;; (symbol-name symbol) doesn't. Add an
6368
;; optional \ to catch this.
6469
(concat "\\\\?"
6570
(regexp-quote (symbol-name symbol))))))
66-
(case-fold-search))
71+
(case-fold-search))
6772
(el-patch-wrap 1 0
6873
(save-excursion
6974
(save-restriction
@@ -73,14 +78,15 @@ The search is done in the source for library LIBRARY."
7378
(if (if (functionp regexp)
7479
(funcall regexp symbol)
7580
(or (re-search-forward regexp nil t)
76-
;; `regexp' matches definitions using known forms like
77-
;; `defun', or `defvar'. But some functions/variables
78-
;; are defined using special macros (or functions), so
79-
;; if `regexp' can't find the definition, we look for
80-
;; something of the form "(SOMETHING <symbol> ...)".
81-
;; This fails to distinguish function definitions from
82-
;; variable declarations (or even uses thereof), but is
83-
;; a good pragmatic fallback.
81+
;; `regexp' matches definitions using known forms
82+
;; like `defun', or `defvar'. But some
83+
;; functions/variables are defined using special
84+
;; macros (or functions), so if `regexp' can't find
85+
;; the definition, we look for something of the
86+
;; form "(SOMETHING <symbol> ...)". This fails to
87+
;; distinguish function definitions from variable
88+
;; declarations (or even uses thereof), but is a
89+
;; good pragmatic fallback.
8490
(re-search-forward
8591
(concat "^([^ ]+" find-function-space-re "['(]?"
8692
(regexp-quote (symbol-name symbol))

0 commit comments

Comments
 (0)