update packages

This commit is contained in:
2025-03-11 21:14:26 +01:00
parent 45d49daef0
commit 14dcaaddde
440 changed files with 13229 additions and 8718 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
(define-package "anaconda-mode" "20231123.1806" "Code navigation, documentation lookup and completion for Python"
(define-package "anaconda-mode" "20250310.1512" "Code navigation, documentation lookup and completion for Python"
'((emacs "25.1")
(pythonic "0.1.0")
(dash "2.6.0")
(s "1.9")
(f "0.16.2"))
:commit "92a6295622df7fae563d6b599e2dc8640e940ddf" :authors
:commit "28b3e0088ac7113390aa006bf277c8aa14e561a2" :authors
'(("Artem Malyshev" . "proofit404@gmail.com"))
:maintainers
'(("Artem Malyshev" . "proofit404@gmail.com"))
+5 -5
View File
@@ -94,7 +94,7 @@
(declare-function posframe-show "posframe")
;;; Server.
(defvar anaconda-mode-server-version "0.1.16"
(defvar anaconda-mode-server-version "0.1.17"
"Server version needed to run `anaconda-mode'.")
(defvar anaconda-mode-process-name "anaconda-mode"
@@ -784,14 +784,14 @@ Show ERROR-MESSAGE if result is empty."
(defun turn-on-anaconda-eldoc-mode ()
"Turn on `anaconda-eldoc-mode'."
(add-hook 'eldoc-documentation-functions
'anaconda-mode-eldoc-function nil 't)
(eldoc-mode +1))
#'anaconda-mode-eldoc-function nil 't)
(unless (bound-and-true-p eldoc-mode)
(eldoc-mode +1)))
(defun turn-off-anaconda-eldoc-mode ()
"Turn off `anaconda-eldoc-mode'."
(remove-hook 'eldoc-documentation-functions
'anaconda-mode-eldoc-function 't)
(eldoc-mode -1))
#'anaconda-mode-eldoc-function 't))
(provide 'anaconda-mode)
+12 -4
View File
@@ -1,4 +1,3 @@
from __future__ import print_function
import sys
import os
@@ -25,7 +24,7 @@ if IS_PY2:
jedi_dep = ('jedi', '0.17.2')
server_directory += '-py2'
else:
jedi_dep = ('jedi', '0.19.1')
jedi_dep = ('jedi', '0.19.2')
server_directory += '-py3'
service_factory_dep = ('service_factory', '0.1.6')
@@ -71,10 +70,19 @@ def install_deps_setuptools():
instrument_installation()
def install_deps_pip():
import pathlib
import shutil
import subprocess
cmd = [sys.executable, '-m', 'pip', 'install', '--target', server_directory]
import tempfile
import venv
temp_dir = pathlib.Path(tempfile.mkdtemp())
venv.create(temp_dir, with_pip=True)
cmd = [temp_dir / 'bin' / 'pip', 'install', '--target', server_directory]
cmd.extend(missing_dependencies)
subprocess.check_call(cmd)
try:
subprocess.check_call(cmd)
finally:
shutil.rmtree(temp_dir)
instrument_installation()
if missing_dependencies:
+4 -3
View File
@@ -238,7 +238,8 @@ so we can't just use the preceding variable instead.")
(defun company-capf--post-completion (arg)
(let* ((res company-capf--current-completion-data)
(exit-function (plist-get (nthcdr 4 res) :exit-function))
(table (nth 3 res)))
(table (nth 3 res))
(prefix (nth 0 (company-capf--prefix))))
(if exit-function
;; Follow the example of `completion--done'.
(funcall exit-function arg
@@ -247,8 +248,8 @@ so we can't just use the preceding variable instead.")
;; particular candidate explicitly (it only checks whether
;; further completions exist). Whereas company user can press
;; RET (or use implicit completion with company-tng).
(if (= (car (completion-boundaries arg table nil ""))
(length arg))
(if (= (car (completion-boundaries prefix table nil ""))
(length prefix))
'exact
'finished)))))
+2 -2
View File
@@ -1,6 +1,6 @@
(define-package "company" "20250223.352" "Modular text completion framework"
(define-package "company" "20250228.258" "Modular text completion framework"
'((emacs "26.1"))
:commit "5bb6f6d3d44ed919378e6968a06feed442165545" :maintainers
:commit "8d599ebc8a9aca27c0a6157aeb31c5b7f05ed0a3" :maintainers
'(("Dmitry Gutov" . "dmitry@gutov.dev"))
:maintainer
'("Dmitry Gutov" . "dmitry@gutov.dev")
+76 -76
View File
@@ -1,4 +1,4 @@
This is company.info, produced by makeinfo version 6.8 from
This is company.info, produced by makeinfo version 7.1.1 from
company.texi.
This user manual is for Company version 1.0.3-snapshot
@@ -47,7 +47,7 @@ Copyright © 2021-2024 Free Software Foundation, Inc.
* Troubleshooting:: When Something Goes Wrong
* Index::
The Detailed Node Listing
-- The Detailed Node Listing --
Overview
@@ -122,8 +122,8 @@ configurable through the user option completion-styles, which see.
For illustrations on how Company visualizes the matches, *note
Frontends::.
The packages name Company is based on the combination of the two
words: Complete and Anything. These words reflect the packages
The package's name Company is based on the combination of the two
words: Complete and Anything. These words reflect the package's
commitment to handling completion candidates and its extensible nature
allowing it to cover a wide range of usage scenarios.
@@ -154,10 +154,10 @@ commands for the user to operate with. For more details, *note
Customization:: and *note Commands::.
Also, Company is bundled with an alternative workflow configuration
“company-tng” defining company-tng-frontend, company-tng-mode, and
company-tng-map that allows performing completion with just <TAB>.
To enable this configuration, add the following line to the Emacs
initialization file (*note (emacs)Init File::):
“company-tng” -- defining company-tng-frontend, company-tng-mode,
and company-tng-map -- that allows performing completion with just
<TAB>. To enable this configuration, add the following line to the
Emacs initialization file (*note (emacs)Init File::):
(add-hook 'after-init-hook 'company-tng-mode)
@@ -216,7 +216,7 @@ File: company.info, Node: Usage Basics, Next: Commands, Prev: Initial Setup,
2.3 Usage Basics
================
By default having _company-mode_ enabled (*note Initial Setup::) a
By default -- having _company-mode_ enabled (*note Initial Setup::) -- a
tooltip with completion candidates is shown when the user types a few
characters.
@@ -228,7 +228,7 @@ respectively key bindings C-n and C-p, then do one of the following:
• Hit <RET> to choose a selected candidate for completion.
• Hit <TAB> to expand the “common part” of all completions. Exactly
what that means, can vary by backend. In the simplest case its
what that means, can vary by backend. In the simplest case it's
the longest string that all completion start with, but when a
backend returns _non-prefix matches_, it can implement the same
kind of expansion logic for the input string.
@@ -261,8 +261,8 @@ commands of the out-of-the-box Company.
TAB
<tab>
Insert the _common part_ of all completion candidates or if no
_common part_ is present select the next candidate
Insert the _common part_ of all completion candidates or -- if no
_common part_ is present -- select the next candidate
(company-complete-common-or-cycle). In the latter case,
wraparound is implicitly enabled (*note
company-selection-wrap-around::).
@@ -360,7 +360,7 @@ core settings that influence its overall behavior.
than the default value of 3.
-- User Option: company-idle-delay
This is the second of the options that configure Companys
This is the second of the options that configure Company's
auto-start behavior (together with
company-minimum-prefix-length). The value of this option defines
how fast Company is going to react to the typed input, such that
@@ -390,7 +390,7 @@ core settings that influence its overall behavior.
(setq company-global-modes '(not erc-mode message-mode eshell-mode))
-- User Option: company-selection-wrap-around
Enable this option to loop (cycle) the candidates selection: after
Enable this option to loop (cycle) the candidates' selection: after
selecting the last candidate on the list, a command to select the
next candidate does so with the first candidate. By default, this
option is disabled, which means the selection of the next candidate
@@ -398,7 +398,7 @@ core settings that influence its overall behavior.
influenced by this option similarly.
-- User Option: company-require-match
To allow typing in characters that dont match the candidates, set
To allow typing in characters that don't match the candidates, set
the value of this option to nil. For an opposite behavior (that
is, to disallow non-matching input), set it to t. By default,
Company is configured to require a matching input only if the user
@@ -484,7 +484,7 @@ listed below.
-- Function: company-pseudo-tooltip-unless-just-one-frontend
This is one of the default frontends. It starts displaying a
tooltip only if more than one completion candidate is available,
which nicely combines and it is done so by default with
which nicely combines -- and it is done so by default -- with
company-preview-if-just-one-frontend, *note Preview Frontends::.
-- Function: company-pseudo-tooltip-frontend
@@ -535,7 +535,7 @@ user options.
[image src="./images/small/tooltip-annotations.png"]
-- User Option: company-tooltip-annotation-padding
Adds left padding to the candidates annotations. It is disabled
Adds left padding to the candidates' annotations. It is disabled
by default. If company-tooltip-align-annotations is enabled,
company-tooltip-annotation-padding defines the minimum spacing
between a candidate and annotation, with the default value of 1.
@@ -545,7 +545,7 @@ user options.
-- User Option: company-tooltip-limit
Controls the maximum number of the candidates shown simultaneously
in the tooltip (the default value is 10). When the number of the
available candidates is larger than this options value, Company
available candidates is larger than this option's value, Company
paginates the results.
(setq company-tooltip-limit 4)
@@ -622,7 +622,7 @@ user options.
Candidates Icons
----------------
An “icon” is an image or a text that represents a candidates kind; it
An “icon” is an image or a text that represents a candidate's kind; it
is displayed in front of a candidate. The term “kind” here stands for a
high-level category a candidate fits into. (Such as array,
function, file, string, color, etc. For an extended list of the
@@ -631,7 +631,7 @@ the variable company-vscode-icons-mapping.)
-- User Option: company-format-margin-function
Allows setting a function to format the left margin of a tooltip
inner area; namely, to output candidates _icons_. The predefined
inner area; namely, to output candidate's _icons_. The predefined
formatting functions are listed below. The user may also set this
option to a custom function. To disable left margin formatting,
set the value of the option to nil (this way control over the
@@ -664,7 +664,7 @@ The following user options influence appearance of the _text_ and _dot_
_icons_.
-- User Option: company-text-icons-mapping
Lists candidates _kinds_ with their corresponding _icons_
Lists candidates' _kinds_ with their corresponding _icons_
configurations.
-- User Option: company-text-face-extra-attributes
@@ -676,7 +676,7 @@ _icons_.
[image src="./images/small/tooltip-icon-face.png"]
-- User Option: company-text-icons-add-background
If this option is enabled, when an _icon_ doesnt have a background
If this option is enabled, when an _icon_ doesn't have a background
configured by company-text-icons-mapping, then a generated
background is applied.
@@ -696,8 +696,8 @@ Faces
Out-of-the-box Company defines and configures distinguished faces (*note
(emacs)Faces::) for light and dark themes. Moreover, some of the
built-in and third-party themes fine-tune Company to fit their palettes.
That is why theres often no real need to make such adjustments on the
users side. However, this chapter presents some hints on where to
That is why there's often no real need to make such adjustments on the
user's side. However, this chapter presents some hints on where to
start customizing Company interface.
Namely, the look of a tooltip is controlled by the company-tooltip*
@@ -770,7 +770,7 @@ File: company.info, Node: Echo Frontends, Next: Candidates Search, Prev: Prev
4.3 Echo Frontends
==================
The frontends listed in this section display information in the Emacss
The frontends listed in this section display information in the Emacs's
echo area, *note (emacs)Echo Area::.
-- Function: company-echo-metadata-frontend
@@ -781,7 +781,7 @@ echo area, *note (emacs)Echo Area::.
[image src="./images/small/echo-meta.png"]
The last pair of the built-in frontends isnt that commonly used and not
The last pair of the built-in frontends isn't that commonly used and not
as full-featured as the previously reviewed _tooltip-_ and _preview-_
frontends, but still, feel free to play with them and have some fun!
@@ -814,7 +814,7 @@ File: company.info, Node: Candidates Search, Next: Filter Candidates, Prev: E
By default, when _company-mode_ is in action, a key binding C-s starts
looking for matches to additionally typed characters among the displayed
candidates. When a search is initiated, an indicator
Search: CHARACTERS is shown in the Emacss mode line.
Search: CHARACTERS is shown in the Emacs's mode line.
To quit the search mode, hit C-g.
@@ -1016,7 +1016,7 @@ roughly outlined groups of the backends.
Some of the backends expose user options for customization; a few of
these options are introduced below. For those who would like to fetch
the full list of a backends user options, we suggest doing one of the
the full list of a backend's user options, we suggest doing one of the
following:
• Execute command M-x customize-group <RET> <backend-name>.
@@ -1041,7 +1041,7 @@ File: company.info, Node: Code Completion, Next: Text Completion, Up: Package
---------------------
-- Function: company-capf
The current trend in the Emacss world is to delegate completion
The current trend in the Emacs's world is to delegate completion
logic to the hook completion-at-point-functions (CAPF) assigned
to by the major or minor modes. It supports a common subset of
features which is well-supported across different completion UIs.
@@ -1063,8 +1063,8 @@ File: company.info, Node: Code Completion, Next: Text Completion, Up: Package
-- User Option: company-capf-disabled-functions
List of completion functions which should be ignored by this
backend. By default it contains the functions that duplicate the
built-in backends but dont support the corresponding configuration
options and/or alter the intended priority of the default backends
built-in backends but don't support the corresponding configuration
options and/or alter the intended priority of the default backends'
configuration.
-- Function: company-dabbrev-code
@@ -1113,7 +1113,7 @@ File: company.info, Node: Code Completion, Next: Text Completion, Up: Package
interface of the program clang, but without any advanced caching
across calls, or automatic detection of the project structure.
Which makes it more suitable for small to medium projects,
especially if youre willing to customize
especially if you're willing to customize
company-clang-arguments. Otherwise we recommend using one of the
LSP clients available for Emacs, together with the backend
company-capf.
@@ -1137,7 +1137,7 @@ File: company.info, Node: Code Completion, Next: Text Completion, Up: Package
program _etags_, *note (emacs)Tags Tables::.
-- User Option: company-etags-ignore-case
Non-nil to ignore case in this backends completions.
Non-nil to ignore case in this backend's completions.
-- User Option: company-etags-everywhere
Non-nil to offer completions in comments and strings. It can also
@@ -1159,7 +1159,7 @@ File: company.info, Node: Text Completion, Next: File Name Completion, Prev:
This backend works similarly to the built-in Emacs package
_dabbrev_, searching for completion candidates inside the contents
of the open buffer(s). It is one of the often used backends, and
it has several interesting options for configuration. Lets review
it has several interesting options for configuration. Let's review
a few of them.
-- User Option: company-dabbrev-minimum-length
@@ -1202,7 +1202,7 @@ File: company.info, Node: Text Completion, Next: File Name Completion, Prev:
nil, Enjoy is suggested as a completion candidate for the
typed Enj letters, but not for enj. When the option is
set to t, Enjoy is suggested as a candidate for both Enj
and enj input; note that enj prefix is overwritten by
and enj input; note that enj prefix is "overwritten" by
completing with the Enjoy candidate. The third, default,
type of behavior solves this issue, keeping the case of the
typed prefix (and still collecting candidates
@@ -1221,7 +1221,7 @@ File: company.info, Node: Text Completion, Next: File Name Completion, Prev:
being suggested. When the option is set to t, the
down-cased candidate enjoy is suggested. By default, this
option is set to case-replace, meaning taking a value of the
Emacss variable case-replace (t is the current default).
Emacs's variable case-replace (t is the current default).
-- Function: company-ispell
@@ -1231,7 +1231,7 @@ File: company.info, Node: Text Completion, Next: File Name Completion, Prev:
_Ispell_ uses only one dictionary at a time (combining several
dictionaries into one file is an accepted practice). By default,
_company-ispell_ suggests candidates from a dictionary specified by
the Emacss setting ispell-complete-word-dict.
the Emacs's setting ispell-complete-word-dict.
-- User Option: company-ispell-dictionary
Optionally, set a file path for _company-ispell_ to use
@@ -1252,7 +1252,7 @@ File: company.info, Node: File Name Completion, Next: Template Expansion, Pre
-- User Option: company-files-exclusions
It may be desirable to exclude directories or files from the
list of suggested completion candidates. For example,
someones setup might look this way:
someone's setup might look this way:
(setq company-files-exclusions '(".git/" ".DS_Store"))
@@ -1378,7 +1378,7 @@ Based on the value of the Used backend in the output of the command
caused by a function listed there. To identify to which package it
belongs, type M-x find-function <RET> <function-name> <RET>.
If the aforementioned steps didnt help to find the cause of the issue,
If the aforementioned steps didn't help to find the cause of the issue,
then file a bug report to
the Company Issue Tracker (https://github.com/company-mode/company-mode/issues),
attaching the following information:
@@ -1775,45 +1775,45 @@ Concept Index

Tag Table:
Node: Top573
Node: Top575
Node: Overview2002
Node: Terminology2410
Node: Structure3717
Node: Getting Started5208
Node: Installation5486
Node: Initial Setup5869
Node: Usage Basics6717
Node: Commands7695
Ref: Commands-Footnote-110093
Node: Customization10260
Node: Customization Interface10732
Node: Configuration File11265
Ref: company-selection-wrap-around13579
Node: Frontends16072
Node: Tooltip Frontends17041
Ref: Tooltip Frontends-Footnote-127755
Node: Preview Frontends27992
Ref: Preview Frontends-Footnote-129250
Node: Echo Frontends29377
Node: Candidates Search30910
Node: Filter Candidates32244
Node: Quick Access a Candidate33024
Node: Backends34642
Node: Backends Usage Basics35672
Ref: Backends Usage Basics-Footnote-137104
Node: Grouped Backends37188
Node: Package Backends38699
Node: Code Completion39628
Node: Text Completion45155
Node: File Name Completion49589
Node: Template Expansion51137
Node: Candidates Post-Processing51856
Node: Troubleshooting54433
Node: Index56106
Node: Key Index56269
Node: Variable Index57768
Node: Function Index62621
Node: Concept Index67321
Node: Structure3713
Node: Getting Started5203
Node: Installation5481
Node: Initial Setup5864
Node: Usage Basics6712
Node: Commands7686
Ref: Commands-Footnote-110082
Node: Customization10249
Node: Customization Interface10721
Node: Configuration File11254
Ref: company-selection-wrap-around13566
Node: Frontends16055
Node: Tooltip Frontends17024
Ref: Tooltip Frontends-Footnote-127720
Node: Preview Frontends27957
Ref: Preview Frontends-Footnote-129215
Node: Echo Frontends29342
Node: Candidates Search30871
Node: Filter Candidates32203
Node: Quick Access a Candidate32983
Node: Backends34601
Node: Backends Usage Basics35631
Ref: Backends Usage Basics-Footnote-137063
Node: Grouped Backends37147
Node: Package Backends38658
Node: Code Completion39585
Node: Text Completion45102
Node: File Name Completion49526
Node: Template Expansion51072
Node: Candidates Post-Processing51791
Node: Troubleshooting54368
Node: Index56039
Node: Key Index56202
Node: Variable Index57701
Node: Function Index62554
Node: Concept Index67254

End Tag Table
+2 -2
View File
@@ -1,8 +1,8 @@
(define-package "counsel" "20250224.2125" "Various completion functions using Ivy"
(define-package "counsel" "20250304.939" "Various completion functions using Ivy"
'((emacs "24.5")
(ivy "0.15.0")
(swiper "0.15.0"))
:commit "7a0d554aaf4ebbb2c45f2451d77747df4f7e2742" :authors
:commit "db61f55bc281c28beb723ef17cfe74f59580d2f4" :authors
'(("Oleh Krehel" . "ohwoeowho@gmail.com"))
:maintainers
'(("Basil L. Contovounesios" . "basil@contovou.net"))
+187 -169
View File
@@ -5670,8 +5670,11 @@ You can insert or kill the name of the selected font."
map))
(defun counsel-kmacro-kill ()
"Kill the line, or delete the keyboard macro."
"Kill the line, or delete the currently selected keyboard macro."
(declare (modes minibuffer-mode))
(interactive)
(unless (window-minibuffer-p)
(user-error "No completion session is active"))
(if (not (eolp))
(ivy-kill-line)
(counsel-kmacro-action-delete-kmacro
@@ -5680,36 +5683,41 @@ You can insert or kill the name of the selected font."
(ivy-state-collection ivy-last)))
(ivy--kill-current-candidate)))
(defvar kmacro-ring)
(defvar kmacro-initial-counter-value)
(defvar kmacro-counter)
(defvar kmacro-counter-value-start)
(defvar kmacro-counter-format-start)
(defvar kmacro-ring)
(declare-function kmacro-cycle-ring-next "kmacro" (&optional arg))
(declare-function kmacro-cycle-ring-previous "kmacro" (&optional arg))
(declare-function kmacro-delete-ring-head "kmacro" (&optional arg))
(declare-function kmacro-ring-head "kmacro" ())
(declare-function kmacro-set-counter "kmacro" (arg))
(declare-function kmacro-set-format "kmacro" (format))
(declare-function kmacro-split-ring-element "kmacro" (elt))
;;;###autoload
(defun counsel-kmacro ()
"Interactively choose and run a keyboard macro.
"Interactively choose and execute a keyboard macro.
With prefix argument, run macro that many times.
With a prefix argument, execute the macro that many times.
Macros are run using the current value of `kmacro-counter-value'
and their respective counter format. Displayed next to each macro is
the counter's format and initial value.
Macros are executed using their respective `kmacro-counter' value and
counter format; these values are also displayed next to each completion
candidate.
One can use actions to copy the counter format or initial counter
value of a macro, using them for a new macro."
The default actions include the ability to copy one macro's counter
value or format as the basis for another macro execution or definition.
The following key bindings are also available:
\\{counsel-kmacro-map}"
(interactive)
(if (or last-kbd-macro kmacro-ring)
(ivy-read
(concat "Execute macro (counter at "
(number-to-string (or kmacro-initial-counter-value kmacro-counter))
"): ")
(counsel--kmacro-candidates)
:keymap counsel-kmacro-map
:require-match t
:action #'counsel-kmacro-action-run
:caller 'counsel-kmacro)
(user-error "No keyboard macros defined")))
(require 'kmacro)
(ivy-read "Execute macro: "
(or (counsel--kmacro-candidates)
(user-error "No keyboard macros defined"))
:keymap counsel-kmacro-map
:require-match t
:action #'counsel-kmacro-action-run
:caller 'counsel-kmacro))
(ivy-configure 'counsel-kmacro
:format-fn #'counsel--kmacro-format-function)
@@ -5722,176 +5730,186 @@ value of a macro, using them for a new macro."
"Transform FORMATTED-KMACRO into a string for `counsel-kmacro'."
(ivy--format-function-generic
(lambda (str) (ivy--add-face str 'ivy-current-match))
(lambda (str) str)
#'identity
formatted-kmacro
(propertize counsel-kmacro-separator 'face 'ivy-separator)))
(defmacro counsel--with-kmacro (kmacro &rest body)
"Split KMACRO slots into corresponding dynvars around BODY."
(declare (debug t) (indent 1))
`(let ((last-kbd-macro nil)
(kmacro-counter nil)
(kmacro-counter-format-start nil))
;; Works with both older triplets and Emacs 29 OClosures.
(kmacro-split-ring-element ,kmacro)
,@body))
(defun counsel--format-kmacro ()
"Return string representation of current keyboard macro."
(format "(%s,%s): %s" kmacro-counter-format-start kmacro-counter
(condition-case err
(format-kbd-macro last-kbd-macro 1)
;; Recover from error in `edmacro-fix-menu-commands',
;; especially prior to mouse event support in Emacs 27.
(error
(format (propertize "[Unprintable macro: %s]" 'face 'warning)
(error-message-string err))))))
(defun counsel--kmacro-candidates ()
"Create the list of keyboard macros used by `counsel-kmacro'.
This is a combination of `kmacro-ring' and, together in a list,
`last-kbd-macro', `kmacro-counter-format-start', and
`kmacro-counter-value-start'."
(mapcar
(lambda (kmacro)
(cons
(concat "(" (nth 2 kmacro) "," (number-to-string (nth 1 kmacro)) "): "
(condition-case nil
(format-kbd-macro (if (listp kmacro) (car kmacro) kmacro) 1)
;; Recover from error from `edmacro-fix-menu-commands'.
(error "Warning: Cannot display macros containing mouse clicks")))
kmacro))
(cons
(if (listp last-kbd-macro)
last-kbd-macro
(list
last-kbd-macro
kmacro-counter-value-start
kmacro-counter-format-start))
kmacro-ring)))
"Return an alist of known keyboard macros for `counsel-kmacro'.
The cdrs are the original `kmacro' objects from `kmacro-ring-head' and
`kmacro-ring'; the cars are a corresponding string representation."
(mapcar (lambda (km)
(cons (counsel--with-kmacro km
(counsel--format-kmacro))
km))
(let ((head (kmacro-ring-head)))
(and head (cons head kmacro-ring)))))
(defun counsel-kmacro-action-run (x)
"Run keyboard macro."
(let* ((actual-kmacro (cdr x))
(kmacro-keys (nth 0 actual-kmacro))
(kmacro-counter-format-start (nth 2 actual-kmacro)))
;; With prefix argument, call the macro that many times.
(kmacro-call-macro (or current-prefix-arg 1) t nil kmacro-keys)))
(defun counsel--kmacro-exec (kmacro n)
"Execute KMACRO ring item N times."
(funcall (if (and (fboundp 'kmacro-p) (kmacro-p kmacro))
#'funcall ;; Emacs 29 OClosure.
'kmacro-exec-ring-item)
kmacro n))
(defun counsel-kmacro-action-delete-kmacro (x)
"Delete a keyboard macro from within `counsel-kmacro'.
(defun counsel-kmacro-action-run (candidate)
"Execute keyboard macro from `counsel-kmacro' CANDIDATE.
With a prefix argument, execute the macro that many times."
;; Action prefix overrides `counsel-kmacro' prefix.
(let* ((pre (or ivy-current-prefix-arg current-prefix-arg))
(km (cdr candidate))
(head (equal km (kmacro-ring-head))))
(counsel--kmacro-exec km (prefix-numeric-value pre))
(when head
;; Executing pseudo `kmacro-ring-head' updates that object's counter,
;; but not the current `kmacro-counter', so reconcile them here.
(kmacro-split-ring-element km))
;; Update state for next `ivy-call'.
(counsel--with-kmacro km
(setcar candidate (counsel--format-kmacro))))
(setf (ivy-state-current ivy-last) (car candidate))
(setf (ivy-state-preselect ivy-last) ivy--index)
(ivy--reset-state ivy-last))
Either delete a macro from `kmacro-ring', or set `last-kbd-macro'
(defun counsel-kmacro-action-delete-kmacro (candidate)
"Delete the keyboard macro in `counsel-kmacro' CANDIDATE.
Either delete it from `kmacro-ring', or set `last-kbd-macro'
to the popped head of the ring."
(let ((actual-macro (cdr x)))
(if (eq (nth 0 actual-macro) last-kbd-macro)
(setq last-kbd-macro
(if (eq kmacro-ring nil)
nil
(let ((prev-macro (pop kmacro-ring)))
(if (listp prev-macro)
(nth 0 prev-macro)
prev-macro))))
(setq kmacro-ring (delq actual-macro kmacro-ring)))))
(let ((km (cdr candidate)))
(if (memq km kmacro-ring)
(setq kmacro-ring (delq km kmacro-ring))
(kmacro-delete-ring-head)))
;; Update state for next `ivy-call'.
;; TODO: Is `ivy--kill-current-candidate' required?
(let ((kms (ivy-state-collection ivy-last)))
(setf (ivy-state-collection ivy-last) (delq candidate kms))
(setf (ivy-state-preselect ivy-last)
(max 0 (min ivy--index (1- (length kms))))))
(ivy--reset-state ivy-last))
(defun counsel-kmacro-action-copy-initial-counter-value (x)
"Pass an existing keyboard macro's original value to `kmacro-set-counter'.
This value will be used by the next executed macro, or as an
initial value by the next macro defined.
(defun counsel-kmacro-action-copy-initial-counter-value (candidate)
"Pass `counsel-kmacro' CANDIDATE's counter value to `kmacro-set-counter'.
This value will be used by the next executed macro, or as a
starting value by the next macro defined.
Note that calling an existing macro that itself uses a counter
effectively resets the initial counter value for the next defined macro
to 0."
;; NOTE:
;; Calling `kmacro-start-macro' without an argument sets `kmacro-counter'
;; to 0 if `kmacro-initial-counter'is nil, and sets `kmacro-initial-counter'
;; to nil regardless.
;; Using `kmacro-insert-counter' sets `kmacro-initial-counter' to nil.
(let* ((actual-kmacro (cdr x))
(number (nth 1 actual-kmacro)))
(kmacro-set-counter number)))
Note that executing an existing macro that itself uses a counter
effectively resets the starting counter value for the next macro
definition to 0."
(kmacro-set-counter (counsel--with-kmacro (cdr candidate)
kmacro-counter)))
(defun counsel-kmacro-action-copy-counter-format-for-new-macro (x)
"Set the default keyboard macro counter format.
This sets `kmacro-default-counter-format' to the counter format
of an existing keyboard macro.
(defun counsel-kmacro-action-copy-counter-format-for-new-macro (candidate)
"Pass `counsel-kmacro' CANDIDATE's counter format to `kmacro-set-format'.
This will apply to the next macro a user defines."
(let* ((actual-kmacro (cdr x))
(format (nth 2 actual-kmacro)))
(kmacro-set-format format)))
When no keyboard macro is being defined or executed, this affects the
default for all subsequent macro definitions."
(kmacro-set-format (counsel--with-kmacro (cdr candidate)
kmacro-counter-format-start)))
(declare-function kmacro-cycle-ring-previous "kmacro" (&optional arg))
(declare-function kmacro-set-format "kmacro" (format))
(declare-function kmacro-set-counter "kmacro" (arg))
(defun counsel--kmacro-cycle-until (kmacro)
"Cycle macro ring until KMACRO is the head; return number of steps."
(let ((i 0)
;; Purely defensive; infloop should never happen.
;; Purely defensive; infloop should never happen.
;; Purely defensive; infloop should never happen.[Quit]
(fuel (* 4 (1+ (length kmacro-ring)))))
(while (not (equal kmacro (kmacro-ring-head)))
(unless (natnump (cl-decf fuel))
(error "`counsel-kmacro' bug: exceeded cycle limit"))
(kmacro-cycle-ring-previous)
(cl-incf i))
i))
(defun counsel-kmacro-action-cycle-ring-to-macro (x)
(defun counsel-kmacro-action-cycle-ring-to-macro (candidate)
"Cycle `kmacro-ring' until `last-kbd-macro' is the selected macro.
This is convenient when using \\[kmacro-end-or-call-macro] to call macros.
Note that cycling the ring changes the starting value of the current macro
to changes the current macro counter."
(let ((actual-kmacro (cdr x)))
(unless (equal last-kbd-macro
(if (listp last-kbd-macro)
last-kbd-macro
(car actual-kmacro)))
(while (not (equal actual-kmacro
(car kmacro-ring)))
(kmacro-cycle-ring-previous))
;; Once selected macro is at the head of the ring,
;; cycle one last time.
(kmacro-cycle-ring-previous))))
This is convenient when using \\[kmacro-end-or-call-macro] to call macros."
(counsel--kmacro-cycle-until (cdr candidate))
;; Update state for next `ivy-call'.
(setf (ivy-state-collection ivy-last) (counsel--kmacro-candidates))
(ivy--reset-state ivy-last))
(defun counsel-kmacro-action-set-saved-starting-counter (x)
"Set the starting counter value of the chosen macro.
(defun counsel-kmacro-action-set-saved-starting-counter (candidate)
"Set the counter value of `counsel-kmacro' CANDIDATE.
Interactively reads a new counter value from the minibuffer.
By default, sets to current value of the counter. It has no
effect when selecting the current macro.
Note that this requires cycling the keyboard macro ring until CANDIDATE,
and then cycling back."
(let* ((km (cdr candidate))
(cnt (counsel--with-kmacro km kmacro-counter))
(cnt (if (zerop cnt) cnt (list 0 cnt)))
(i (counsel--kmacro-cycle-until km)))
(setq kmacro-counter (read-number "New macro counter: " cnt))
(dotimes (_ i) (kmacro-cycle-ring-next)))
;; Update state for next `ivy-call'.
(setf (ivy-state-collection ivy-last) (counsel--kmacro-candidates))
(setf (ivy-state-preselect ivy-last) ivy--index)
;; Emacs 28 seems to have some bug where the text of the candidates
;; in the minibuffer is not immediately refreshed.
(ivy--reset-state ivy-last))
Normally, when cycling keyboard macro ring with \\[kmacro-cycle-ring-previous]
or \\[kmacro-cycle-ring-next], the current value of the macro counter is
included with the current macro definition. Then, when cycling
back, that counter value is restored. This function is meant to
achieve something similar when cycling macros in the context of
using `counsel-kmacro', which does not use different counter
values when running different macros."
(let ((actual-kmacro (cdr x))
(default-kmacro-counter-string (number-to-string kmacro-counter)))
(setq kmacro-ring (mapcar (lambda (this-macro-in-ring)
(if (equal this-macro-in-ring actual-kmacro)
(list (car this-macro-in-ring)
(read-from-minibuffer (concat "Set initial counter for macro (default: "
default-kmacro-counter-string
"): ")
nil nil t nil
default-kmacro-counter-string)
(cl-caddr this-macro-in-ring))
this-macro-in-ring))
kmacro-ring))))
(defun counsel-kmacro-action-execute-after-prompt (candidate)
"Execute selected keyboard macro with a different counter and format.
(defun counsel-kmacro-action-execute-after-prompt (x)
"Execute an existing keyboard macro, prompting for a starting counter value, a
counter format, and the number of times to execute the macro.
Prompt for the number of times to execute the macro, the starting
counter, and the counter format. The corresponding values from the
selected `counsel-kmacro' CANDIDATE serve as defaults. If this action
is called with a prefix argument, its numeric value also serves as a
default option for the number of iterations and counter.
If called with a prefix, will suggest that value for both the
counter value and iteration amount."
(let* ((default-string (if current-prefix-arg
(number-to-string current-prefix-arg)
nil))
(actual-kmacro (cdr x))
(kmacro-keys (nth 0 actual-kmacro))
(kmacro-starting-counter (number-to-string (nth 1 actual-kmacro)))
(kmacro-starting-format (nth 2 actual-kmacro))
(number-of-iterations
(read-from-minibuffer
(concat "Enter number of iterations for macro (default: "
(or default-string (number-to-string 2))
"): ")
nil nil t nil
(or default-string (number-to-string 2))))
(kmacro-initial-counter-value
(read-from-minibuffer
(concat "Enter a starting counter for macro (default: "
(or default-string kmacro-starting-counter)
"): ")
nil nil t nil
(or default-string kmacro-starting-counter)))
(kmacro-counter-format-start
(symbol-name (read-from-minibuffer
(concat "Enter format for macro counter (default: "
kmacro-starting-format
"): ")
nil nil t nil
kmacro-starting-format))))
(kmacro-call-macro number-of-iterations t nil kmacro-keys)))
The existing CANDIDATE, its counter and format, are left unchanged."
(let* ((pre (or ivy-current-prefix-arg current-prefix-arg))
(pre (and pre (prefix-numeric-value pre))))
(counsel--with-kmacro (cdr candidate)
(let ((times (read-number "Number of macro iterations: "
(let ((def '(1 2)))
(if pre (cons pre def) def)))))
(setq kmacro-counter
(read-number "Macro counter value: "
(if pre (list pre kmacro-counter) kmacro-counter)))
(setq kmacro-counter-format-start
(let ((prompt "Macro counter format")
(def kmacro-counter-format-start))
(read-string (if (fboundp 'format-prompt)
(format-prompt prompt def)
(format "%s (default: %s): " prompt def))
nil nil def)))
(counsel--kmacro-exec (kmacro-ring-head) times)))))
(ivy-set-actions
'counsel-kmacro
'(("c" counsel-kmacro-action-cycle-ring-to-macro "cycle to")
("d" counsel-kmacro-action-delete-kmacro "delete")
("e" counsel-kmacro-action-execute-after-prompt "execute after prompt")
("f" counsel-kmacro-action-copy-counter-format-for-new-macro "copy counter format for new macro")
("s" counsel-kmacro-action-set-saved-starting-counter "set this counter value")
("v" counsel-kmacro-action-copy-initial-counter-value "copy initial counter value")))
`(("c" ,#'counsel-kmacro-action-cycle-ring-to-macro
"cycle to")
("d" ,#'counsel-kmacro-action-delete-kmacro
"delete")
("e" ,#'counsel-kmacro-action-execute-after-prompt
"execute after prompt")
("f" ,#'counsel-kmacro-action-copy-counter-format-for-new-macro
"copy counter format for new macro")
("s" ,#'counsel-kmacro-action-set-saved-starting-counter
"set this counter value")
("v" ,#'counsel-kmacro-action-copy-initial-counter-value
"copy starting counter value")))
;;** `counsel-geiser-doc-look-up-manual'
(declare-function geiser-doc-manual-for-symbol "ext:geiser-doc")
+391 -391
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,6 +1,6 @@
(define-package "dashboard" "20250212.1925" "A startup screen extracted from Spacemacs"
(define-package "dashboard" "20250227.121" "A startup screen extracted from Spacemacs"
'((emacs "27.1"))
:commit "9adf24569d76e428fb98a562f1f1e087dc9d608d" :authors
:commit "9616e5b5e793c3d8228a8fccf7b9ef7ace365005" :authors
'(("Rakan Al-Hneiti" . "rakan.alhneiti@gmail.com"))
:maintainers
'(("Jen-Chieh" . "jcs090218@gmail.com")
+1
View File
@@ -62,6 +62,7 @@
(define-key map (kbd "C-i") #'widget-forward)
(define-key map [backtab] #'widget-backward)
(define-key map (kbd "RET") #'dashboard-return)
(define-key map (kbd "<touchscreen-begin>") #'widget-button-click)
(define-key map [mouse-1] #'dashboard-mouse-1)
(define-key map (kbd "}") #'dashboard-next-section)
(define-key map (kbd "{") #'dashboard-previous-section)
+1 -1
View File
@@ -1,4 +1,4 @@
(define-package "emacsql-sqlite" "20250223.1743" "Code used by multiple SQLite back-ends" 'nil :commit "e4f1dcae91f91c5fa6dc1b0097a6c524e98fdf2b" :authors
(define-package "emacsql-sqlite" "20250301.1637" "Code used by multiple SQLite back-ends" 'nil :commit "f111b0acc79eadeeb3c6c1332d943f11fd6932ff" :authors
'(("Jonas Bernoulli" . "emacs.emacsql@jonas.bernoulli.dev"))
:maintainers
'(("Jonas Bernoulli" . "emacs.emacsql@jonas.bernoulli.dev"))
+2 -2
View File
@@ -1,6 +1,6 @@
(define-package "emacsql" "20250223.1743" "High-level SQL database front-end"
(define-package "emacsql" "20250301.1637" "High-level SQL database front-end"
'((emacs "26.1"))
:commit "e4f1dcae91f91c5fa6dc1b0097a6c524e98fdf2b" :authors
:commit "f111b0acc79eadeeb3c6c1332d943f11fd6932ff" :authors
'(("Christopher Wellons" . "wellons@nullprogram.com"))
:maintainers
'(("Jonas Bernoulli" . "emacs.emacsql@jonas.bernoulli.dev"))
+2 -2
View File
@@ -6,7 +6,7 @@
;; Maintainer: Jonas Bernoulli <emacs.emacsql@jonas.bernoulli.dev>
;; Homepage: https://github.com/magit/emacsql
;; Package-Version: 4.1.0
;; Package-Version: 4.2.0
;; Package-Requires: ((emacs "26.1"))
;; SPDX-License-Identifier: Unlicense
@@ -32,7 +32,7 @@
"The EmacSQL SQL database front-end."
:group 'comm)
(defconst emacsql-version "4.1.0")
(defconst emacsql-version "4.2.0")
(defvar emacsql-global-timeout 30
"Maximum number of seconds to wait before bailing out on a SQL command.
+1303 -1303
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
(define-package "git-commit" "20250221.105" "Edit Git commit messages" 'nil :commit "d4fdadc127d3d8b98e71d38675bb0438c6ae93f1" :authors
(define-package "git-commit" "20250307.1746" "Edit Git commit messages" 'nil :commit "80cae1a26f13a4d48a19cfe8612a561348423f35" :authors
'(("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev")
("Sebastian Wiesner" . "lunaryorn@gmail.com")
("Florian Ragwitz" . "rafl@debian.org")
+2
View File
@@ -178,6 +178,7 @@ The major mode configured here is turned on by the minor mode
(function-item markdown-mode)
(function-item org-mode)
(function-item fundamental-mode)
(function-item log-edit-mode)
(function-item git-commit-elisp-text-mode)
(function :tag "Another mode")
(const :tag "No major mode")))
@@ -187,6 +188,7 @@ The major mode configured here is turned on by the minor mode
;;;###autoload markdown-mode
;;;###autoload org-mode
;;;###autoload fundamental-mode
;;;###autoload log-edit-mode
;;;###autoload git-commit-elisp-text-mode))))
(defvaralias 'git-commit-mode-hook 'git-commit-setup-hook
+2 -2
View File
@@ -1,10 +1,10 @@
(define-package "helpful" "20250220.545" "A better *help* buffer"
(define-package "helpful" "20250227.1527" "A better *help* buffer"
'((emacs "25")
(dash "2.18.0")
(s "1.11.0")
(f "0.20.0")
(elisp-refs "1.2"))
:commit "5ad8a9ce57b6c076428286c3d25968b449ab6fd3" :authors
:commit "3794389ef685b6a59b3a487d0492c3add3c42c2f" :authors
'(("Wilfred Hughes" . "me@wilfred.me.uk"))
:maintainers
'(("Wilfred Hughes" . "me@wilfred.me.uk"))
+3 -1
View File
@@ -2570,7 +2570,9 @@ For example, \"(some-func FOO &optional BAR)\"."
(cond
((symbolp sym)
(help-function-arglist sym))
((byte-code-function-p sym)
((or (byte-code-function-p sym)
(if (fboundp 'interpreted-function-p)
(interpreted-function-p sym)))
;; argdesc can be a list of arguments or an integer
;; encoding the min/max number of arguments. See
;; Byte-Code Function Objects in the elisp manual.
+76 -76
View File
@@ -1,4 +1,4 @@
This is ivy.info, produced by makeinfo version 6.8 from ivy.texi.
This is ivy.info, produced by makeinfo version 7.1.1 from ivy.texi.
Ivy manual, version 0.15.0
@@ -11,7 +11,7 @@ available choices while previewing in the minibuffer. Selecting the
final candidate is either through simple keyboard character inputs or
through powerful regular expressions.
Copyright (C) 20152025 Free Software Foundation, Inc.
Copyright (C) 2015-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
@@ -44,7 +44,7 @@ Ivy User Manual
* Variable Index::
* Keystroke Index::
The Detailed Node Listing
-- The Detailed Node Listing --
Installation
@@ -144,11 +144,11 @@ Minimalism
Simplicity
..........
Simplicity is about Ivys behavior in the minibuffer. It is also
about the code interface to extend Ivys functionality. The
Simplicity is about Ivy's behavior in the minibuffer. It is also
about the code interface to extend Ivy's functionality. The
minibuffer area behaves as close to fundamental-mode as possible.
SPC inserts a space, for example, instead of being bound to the
more complex minibuffer-complete-word. Ivys code uses
more complex minibuffer-complete-word. Ivy's code uses
easy-to-examine global variables; avoids needless complications
with branch-introducing custom macros.
@@ -163,7 +163,7 @@ Customizability
ivy-format-functions-alist). Or take the customization of
actions, say after the candidate function is selected. RET uses
counsel-describe-function to describe the function, whereas M-o
d jumps to that functions definition in the code. The M-o
d jumps to that function's definition in the code. The M-o
prefix can be uniformly used with characters like d to group
similar actions.
@@ -185,8 +185,8 @@ File: ivy.info, Node: Installation, Next: Getting started, Prev: Introduction
2 Installation
**************
Install Ivy automatically through Emacss package manager, or manually
from Ivys development repository.
Install Ivy automatically through Emacs's package manager, or manually
from Ivy's development repository.
Emacs 24.5 is the oldest version to run Ivy.
@@ -236,7 +236,7 @@ Why install from Git?
• No need to wait for GNU ELPA / MELPA builds
• Easy to revert to previous versions
• Contribute to Ivys development; send patches; pull requests
• Contribute to Ivy's development; send patches; pull requests
Configuration steps
...................
@@ -285,7 +285,7 @@ Here are some basic settings particularly useful for new Ivy users:
If you want, you can go without any customizations at all. The above
settings are the most bang for the buck in terms of customization. So
users that typically dont like customize a lot are advised to look at
users that typically don't like customize a lot are advised to look at
these settings first.
For more advanced customizations, refer to M-x describe-variable
@@ -472,7 +472,7 @@ extends usability of lists in Emacs.
This is useful e.g. when you call find-file to create a new
file, but the desired name matches an existing file. In that case,
using C-j would select that existing file, which isnt what you
using C-j would select that existing file, which isn't what you
want - use this command instead.
C-' (ivy-avy)
@@ -594,7 +594,7 @@ File: ivy.info, Node: Key bindings that alter the minibuffer input, Next: Othe
C-r (ivy-reverse-i-search)
..............................
Starts a recursive completion session through the commands
Starts a recursive completion session through the command's
history.
This works just like C-r at the bash command prompt, where the
@@ -757,7 +757,7 @@ File: ivy.info, Node: Completion Styles, Next: Customization, Prev: Key bindi
5 Completion Styles
*******************
Ivys completion functions rely on a regex builder - a function that
Ivy's completion functions rely on a regex builder - a function that
transforms a string input to a string regex. All current candidates
simply have to match this regex. Each collection can be assigned its
own regex builder by customizing ivy-re-builders-alist.
@@ -770,7 +770,7 @@ of the following:
ivy--regex-fuzzy
regexp-quote
A catch-all key, t, applies to all collections that dont have
A catch-all key, t, applies to all collections that don't have
their own key.
The default is:
@@ -807,15 +807,15 @@ second argument to completing-read for file name completion.

File: ivy.info, Node: ivy--regex-plus, Next: ivy--regex-ignore-order, Up: Completion Styles
5.1 ivyregex-plus
5.1 ivy-regex-plus
==================
ivy--regex-plus is Ivys default completion method.
ivy--regex-plus is Ivy's default completion method.
ivy--regex-plus matches by splitting the input by spaces and
rebuilding it into a regex.
As the search string is typed in Ivys minibuffer, it is transformed
As the search string is typed in Ivy's minibuffer, it is transformed
into valid regex syntax. If the string is "for example", it is
transformed into
@@ -844,7 +844,7 @@ of a negation group.

File: ivy.info, Node: ivy--regex-ignore-order, Next: ivy--regex-fuzzy, Prev: ivy--regex-plus, Up: Completion Styles
5.2 ivyregex-ignore-order
5.2 ivy-regex-ignore-order
==========================
ivy--regex-ignore-order ignores the order of regexp tokens when
@@ -854,13 +854,13 @@ example" will match "example test for".

File: ivy.info, Node: ivy--regex-fuzzy, Prev: ivy--regex-ignore-order, Up: Completion Styles
5.3 ivyregex-fuzzy
5.3 ivy-regex-fuzzy
===================
ivy--regex-fuzzy splits each character with a wild card. Searching
for "for" returns all "f.*o.*r" matches, resulting in a large number
of hits. Yet some searches need these extra hits. Ivy sorts such large
lists using flx packages scoring mechanism, if its installed.
lists using flx package's scoring mechanism, if it's installed.
C-o m toggles the current regexp builder.
@@ -1011,7 +1011,7 @@ File: ivy.info, Node: Defcustoms, Next: Actions, Prev: Faces, Up: Customizat
This is usually the case when there is no text left to delete,
i.e., when DEL is typed at the beginning of the minibuffer.
The default behavior is to quit the completion after DEL a
The default behavior is to quit the completion after DEL - a
handy key to invoke after mistakenly triggering a completion.
Another common option is ignore, which does nothing.
@@ -1448,7 +1448,7 @@ File: ivy.info, Node: Optional arguments for ivy-read, Next: Example - counsel
...........
Is a function to filter the initial collection. It has to be
compatible with all-completions. Tip: most of the time, its
compatible with all-completions. Tip: most of the time, it's
simpler to just apply this filter to the collection argument
itself, e.g. (cl-remove-if-not predicate collection).
@@ -1464,7 +1464,7 @@ File: ivy.info, Node: Optional arguments for ivy-read, Next: Example - counsel
This string argument is included for compatibility with
completing-read, which inserts it into the minibuffer.
Its recommended to use the preselect argument instead of this.
It's recommended to use the preselect argument instead of this.
history
.........
@@ -1498,7 +1498,7 @@ File: ivy.info, Node: Optional arguments for ivy-read, Next: Example - counsel
...........
Is the function called each time the current candidate changes.
This function takes no arguments and is called in the minibuffers
This function takes no arguments and is called in the minibuffer's
post-command-hook. See swiper for an example usage.
sort
@@ -1563,7 +1563,7 @@ the rest of the arguments are for fine-tuning, and could be omitted.
The action argument could also be omitted - but then ivy-read
would do nothing except returning the string result, which you could
later use yourself. However, its recommended that you use the action
later use yourself. However, it's recommended that you use the action
argument.
(defun counsel-describe-function ()
@@ -1599,14 +1599,14 @@ that they appear:
input is necessary.
• The history argument is for keeping the history of this command
separate from the common history in ivy-history.
• The require-match is set to t since it doesnt make sense to
• The require-match is set to t since it doesn't make sense to
call describe-function on an un-interned symbol.
• The action argument calls describe-function on the interned
selected candidate.
• The caller argument identifies this completion session. This is
important, since with the collection being a list of strings and
not a function name, the only other way for ivy-read to identify
"whos calling" and to apply the appropriate customizations is to
"who's calling" and to apply the appropriate customizations is to
examine this-command. But this-command would be modified if
another command called counsel-describe-function.
@@ -1665,8 +1665,8 @@ narrowing) or select a candidate from the visible collection.
order that they appear:
counsel-locate-function takes a string argument and returns a
list of strings. Note that its not compatible with
all-completions, but since were not using that here, might as
list of strings. Note that it's not compatible with
all-completions, but since we're not using that here, might as
well use one argument instead of three.
ivy-more-chars is a simple function that returns e.g. '("2
chars more") asking the user for more input.
@@ -1917,52 +1917,52 @@ File: ivy.info, Node: Keystroke Index, Prev: Variable Index, Up: Top

Tag Table:
Node: Top1192
Node: Introduction3103
Node: Installation5626
Node: Installing from Emacs Package Manager6002
Node: Installing from the Git repository7249
Node: Getting started8079
Node: Basic customization8386
Node: Key bindings8981
Node: Global key bindings9173
Node: Minibuffer key bindings11647
Node: Key bindings for navigation12879
Node: Key bindings for single selection action then exit minibuffer14086
Node: Key bindings for multiple selections and actions keep minibuffer open16770
Node: Key bindings that alter the minibuffer input19391
Node: Other key bindings21338
Node: Hydra in the minibuffer21716
Node: Saving the current completion session to a buffer24134
Node: Completion Styles25546
Node: ivy--regex-plus27304
Node: ivy--regex-ignore-order28790
Node: ivy--regex-fuzzy29158
Node: Customization29655
Node: Faces29841
Node: Defcustoms32270
Node: Actions33596
Node: What are actions?33922
Node: How can different actions be called?34740
Node: How to modify the actions list?35311
Node: Example - add two actions to each command35971
Node: How to undo adding the two actions36930
Node: How to add actions to a specific command37382
Node: Example - define a new command with several actions37798
Node: Test the above function with ivy-occur38735
Node: Packages39577
Node: Commands40542
Node: File Name Completion40727
Node: Using TRAMP42684
Node: Buffer Name Completion44186
Node: Counsel commands44801
Node: API45448
Node: Required arguments for ivy-read46046
Node: Optional arguments for ivy-read46565
Node: Example - counsel-describe-function49991
Node: Example - counsel-locate52975
Node: Example - ivy-read-with-extra-properties56844
Node: Variable Index58122
Node: Keystroke Index65246
Node: Introduction3101
Node: Installation5616
Node: Installing from Emacs Package Manager5988
Node: Installing from the Git repository7235
Node: Getting started8063
Node: Basic customization8370
Node: Key bindings8963
Node: Global key bindings9155
Node: Minibuffer key bindings11629
Node: Key bindings for navigation12861
Node: Key bindings for single selection action then exit minibuffer14068
Node: Key bindings for multiple selections and actions keep minibuffer open16750
Node: Key bindings that alter the minibuffer input19371
Node: Other key bindings21316
Node: Hydra in the minibuffer21694
Node: Saving the current completion session to a buffer24112
Node: Completion Styles25524
Node: ivy--regex-plus27278
Node: ivy--regex-ignore-order28758
Node: ivy--regex-fuzzy29124
Node: Customization29615
Node: Faces29801
Node: Defcustoms32230
Node: Actions33554
Node: What are actions?33880
Node: How can different actions be called?34698
Node: How to modify the actions list?35269
Node: Example - add two actions to each command35929
Node: How to undo adding the two actions36888
Node: How to add actions to a specific command37340
Node: Example - define a new command with several actions37756
Node: Test the above function with ivy-occur38693
Node: Packages39535
Node: Commands40500
Node: File Name Completion40685
Node: Using TRAMP42642
Node: Buffer Name Completion44144
Node: Counsel commands44759
Node: API45406
Node: Required arguments for ivy-read46004
Node: Optional arguments for ivy-read46523
Node: Example - counsel-describe-function49943
Node: Example - counsel-locate52921
Node: Example - ivy-read-with-extra-properties56786
Node: Variable Index58064
Node: Keystroke Index65188

End Tag Table
+78 -78
View File
@@ -1,4 +1,4 @@
This is ledger-mode.info, produced by makeinfo version 6.8 from
This is ledger-mode.info, produced by makeinfo version 7.1.1 from
ledger-mode.texi.
Copyright © 2013, Craig Earls. All rights reserved.
@@ -20,7 +20,7 @@ met:
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
@@ -45,7 +45,7 @@ Overview
Ledger is a command line accounting tool that provides double-entry
accounting based on a text journal. It provides no bells or whistles,
and returns the user to the days before user interfaces were even a
twinkling in their fathers CRT.
twinkling in their father's CRT.
Ledger-mode assists you in maintaining input files for Ledger,
running reports and much more...
@@ -260,7 +260,7 @@ Beyond the two ways of quickly adding transactions (*note Quick Add::)
Ledger-mode assists you by providing robust TAB completion for payees
and accounts. Ledger-mode will scan the existing buffer for payees and
accounts. Included files are not currently included in the completion
scan. Ledger-mode respects Emacss variables that govern TAB
scan. Ledger-mode respects Emacs's variables that govern TAB
completion, see especially tab-always-indent.
To cycle between completions when hitting TAB multiple times, you
@@ -367,7 +367,7 @@ some additional meaning to the states:
call these transactions _pending_, but Ledger-mode uses a slightly
different meaning.
• Pending. Ledger-modes reconciliation function see pending
• Pending. Ledger-mode's reconciliation function see pending
transactions as an intermediate step in reconciling an account.
When doing a reconciliation (*note Reconciliation::), marking a
transaction as pending means that you have seen the transaction
@@ -416,11 +416,11 @@ File: ledger-mode.info, Node: Sorting Transactions, Next: Narrowing Transactio
========================
As you operating on the Ledger files, they may become disorganized. For
the most part, Ledger doesnt care, but our human brains prefer a bit of
the most part, Ledger doesn't care, but our human brains prefer a bit of
order. Sorting the transactions in a buffer into chronological order
can help bring order to chaos. Either using Sort Region menu entry or
typing C-c C-s will sort all of the transactions in a region by date.
Ledger-mode isnt particularly smart about handling dates and it simply
Ledger-mode isn't particularly smart about handling dates and it simply
sorts the transactions using the string at the beginning of the
transaction. So, you should use the preferred ISO 8601 standard date
format YYYY/MM/DD which easily sorts.
@@ -454,7 +454,7 @@ File: ledger-mode.info, Node: Narrowing Transactions, Prev: Sorting Transactio
==========================
Often you will want to run Ledger register reports just to look at a
specific set of transactions. If you dont need the running total
specific set of transactions. If you don't need the running total
calculation handled by Ledger, Ledger-mode provides a rapid way of
narrowing what is displayed in the buffer in a way that is simpler than
the Ledger register command.
@@ -463,7 +463,7 @@ the Ledger register command.
hides all transactions that do _not_ meet a specific regular expression.
The regular expression can match on any part of the transaction. If you
want to find all transactions whose amount ends in .37, you can do
that (I dont know why, but hey, whatever ever floats you aerostat).
that (I don't know why, but hey, whatever ever floats you aerostat).
Using C-c C-f or the Narrow to Regex menu entry, enter a regular
expression in the Minibuffer. Ledger-mode will hide all other
@@ -491,7 +491,7 @@ here:
To show back all transactions simply invoke Narrow to Regex or C-c
C-f again.
If youve edited some transactions after narrowing such that they
If you've edited some transactions after narrowing such that they
would no longer match the regular expression, you can refresh the
narrowed view using C-c C-g.
@@ -523,7 +523,7 @@ instantaneously, unless you are paying cash. When you swipe your debit
card the money may take several days to actually come out of your
account, or a check may take several days to _clear_. That is the root
of the difference between _obligating_ funds and _expending_ funds.
Obligation says you have agreed to pay it, the expenditure doesnt
Obligation says you have agreed to pay it, the expenditure doesn't
happen until the money actually leaves your account. Or in the case of
receiving payment, you have an account receivable until the money has
actually made it to you.
@@ -703,7 +703,7 @@ File: ledger-mode.info, Node: Adding and Editing Reports, Next: Reversing Repo
* Expansion Formats::
* Make Report Transactions Active::
If you type a report name that Ledger-mode doesnt recognize it will
If you type a report name that Ledger-mode doesn't recognize it will
prompt you for a ledger command line to run. That command is
automatically saved with the name given and you can re-run it at any
time.
@@ -783,7 +783,7 @@ File: ledger-mode.info, Node: Make Report Transactions Active, Prev: Expansion
In a large register report it is convenient to be able to jump to the
source transaction. Ledger-mode will automatically include source
information in every register file that doesnt contain a --subtotal
information in every register file that doesn't contain a --subtotal
option. It does this by adding
--prepend-format='%(filename):%(beg_line):' to the register report
command-line you specify. You should never have to see this, but if
@@ -812,7 +812,7 @@ File: ledger-mode.info, Node: Scheduling Transactions, Next: Customizing Ledge
*************************
The Ledger program provides for automating transactions but these
transaction arent _real_, they only exist inside a ledger session and
transaction aren't _real_, they only exist inside a ledger session and
are not reflected in the actual data file. Many transactions are very
repetitive, but may vary slightly in the date they occur on, or the
amount. Some transactions are weekly, monthly, quarterly or annually.
@@ -832,7 +832,7 @@ File: ledger-mode.info, Node: Specifying Upcoming Transactions, Prev: Scheduli
5.1 Specifying Upcoming Transactions
====================================
The format for specifying transactions is identical to Ledgers file
The format for specifying transactions is identical to Ledger's file
format with the exception of the date field. The data field is modified
by surrounding it with brackets and using wild cards and special
characters to specify when the transactions should appear.
@@ -984,7 +984,7 @@ File: ledger-mode.info, Node: Ledger Reconcile Customization Group, Next: Ledg
ledger-reconcile-buffer-header
Header string for the reconcile buffer. If non-nil, the name of
the account being reconciled will be substituted into the %s. If
the account being reconciled will be substituted into the '%s'. If
nil, no header will be displayed. Defaults to "Reconciling account
%s\n\n".
@@ -1007,9 +1007,9 @@ File: ledger-mode.info, Node: Ledger Reconcile Customization Group, Next: Ledg
characters.
ledger-reconcile-sort-key
Key for sorting reconcile buffer. Possible values are (date),
(amount), (payee) or (0) for no sorting, i.e. using ledger
file order. Defaults to (0).
Key for sorting reconcile buffer. Possible values are '(date)',
'(amount)', '(payee)' or '(0)' for no sorting, i.e. using ledger
file order. Defaults to '(0)'.
ledger-reconcile-insert-effective-date nil
If t, prompt for effective date when clearing transactions during
@@ -1134,7 +1134,7 @@ Ledger Exec: Interface to the Ledger command-line accounting program.
Path to the ledger executable.
ledger-init-file-name
Location of the ledger initialization file. nil if you dont have
Location of the ledger initialization file. nil if you don't have
one.

@@ -1487,64 +1487,64 @@ Keystroke Index

Tag Table:
Node: Top1742
Node: Introduction to Ledger-mode2555
Node: Quick Installation2784
Node: Menus3716
Node: Quick Demo4031
Node: Quick Add4461
Node: Reconciliation5559
Node: Reports7243
Node: Narrowing8273
Node: The Ledger Buffer8857
Node: Navigating Transactions9263
Node: Adding Transactions9823
Node: Setting a Transactions Effective Date11322
Node: Quick Balance Display12222
Node: Copying Transactions12754
Node: Editing Amounts13356
Node: Marking Transactions14427
Node: Formatting Transactions16122
Node: Deleting Transactions16720
Node: Sorting Transactions17160
Node: Narrowing Transactions18712
Node: The Reconcile Buffer20562
Node: Basics of Reconciliation21027
Node: Starting a Reconciliation21976
Node: Mark Transactions Pending23825
Node: Edit Transactions During Reconciliation24494
Node: Finalize Reconciliation25137
Node: Adding and Deleting Transactions during Reconciliation25794
Node: Changing Reconciliation Account26378
Node: Changing Reconciliation Target26928
Node: The Report Buffer27246
Node: Running Basic Reports27504
Node: Adding and Editing Reports28937
Node: Expansion Formats30324
Node: Make Report Transactions Active31965
Node: Reversing Report Order32672
Node: Scheduling Transactions33365
Node: Specifying Upcoming Transactions34221
Node: Transactions that occur on specific dates34795
Node: Transactions that occur on specific days35836
Node: Customizing Ledger-mode36965
Node: Ledger-mode Customization37229
Node: Customization Variables37914
Node: Ledger Customization Group38394
Node: Ledger Reconcile Customization Group39034
Node: Ledger Report Customization Group41985
Node: Ledger Faces Customization Group42704
Node: Ledger Post Customization Group44451
Node: Ledger Exec Customization Group45278
Node: Ledger Test Customization Group45777
Node: Ledger Texi Customization Group46179
Node: Generating Ledger Regression Tests46671
Node: Embedding Example results in Ledger Documentation46934
Node: Hacking Ledger-mode47223
Node: Use org-like outlines47448
Node: Concept Index48113
Node: Command & Variable Index53629
Node: Keystroke Index61739
Node: Top1740
Node: Introduction to Ledger-mode2551
Node: Quick Installation2780
Node: Menus3712
Node: Quick Demo4027
Node: Quick Add4457
Node: Reconciliation5555
Node: Reports7239
Node: Narrowing8269
Node: The Ledger Buffer8853
Node: Navigating Transactions9259
Node: Adding Transactions9819
Node: Setting a Transactions Effective Date11316
Node: Quick Balance Display12216
Node: Copying Transactions12748
Node: Editing Amounts13350
Node: Marking Transactions14421
Node: Formatting Transactions16114
Node: Deleting Transactions16712
Node: Sorting Transactions17152
Node: Narrowing Transactions18700
Node: The Reconcile Buffer20544
Node: Basics of Reconciliation21009
Node: Starting a Reconciliation21956
Node: Mark Transactions Pending23805
Node: Edit Transactions During Reconciliation24474
Node: Finalize Reconciliation25117
Node: Adding and Deleting Transactions during Reconciliation25774
Node: Changing Reconciliation Account26358
Node: Changing Reconciliation Target26908
Node: The Report Buffer27226
Node: Running Basic Reports27484
Node: Adding and Editing Reports28917
Node: Expansion Formats30302
Node: Make Report Transactions Active31943
Node: Reversing Report Order32648
Node: Scheduling Transactions33341
Node: Specifying Upcoming Transactions34195
Node: Transactions that occur on specific dates34767
Node: Transactions that occur on specific days35808
Node: Customizing Ledger-mode36937
Node: Ledger-mode Customization37201
Node: Customization Variables37886
Node: Ledger Customization Group38366
Node: Ledger Reconcile Customization Group39006
Node: Ledger Report Customization Group41933
Node: Ledger Faces Customization Group42652
Node: Ledger Post Customization Group44399
Node: Ledger Exec Customization Group45226
Node: Ledger Test Customization Group45723
Node: Ledger Texi Customization Group46125
Node: Generating Ledger Regression Tests46617
Node: Embedding Example results in Ledger Documentation46880
Node: Hacking Ledger-mode47169
Node: Use org-like outlines47394
Node: Concept Index48059
Node: Command & Variable Index53575
Node: Keystroke Index61685

End Tag Table
+9
View File
@@ -0,0 +1,9 @@
(define-package "llama" "20250309.1622" "Compact syntax for short lambda"
'((emacs "26.1")
(compat "30.0.2.0"))
:commit "4d3141aceb70a1c672d1f4e9394037e2407d3a90" :keywords
'("extensions")
:url "https://github.com/tarsius/llama")
;; Local Variables:
;; no-byte-compile: t
;; End:
+552
View File
@@ -0,0 +1,552 @@
;;; llama.el --- Compact syntax for short lambda -*- lexical-binding:t -*-
;; Copyright (C) 2020-2025 Jonas Bernoulli
;; Authors: Jonas Bernoulli <emacs.llama@jonas.bernoulli.dev>
;; Homepage: https://github.com/tarsius/llama
;; Keywords: extensions
;; Package-Version: 0.6.1
;; Package-Requires: ((emacs "26.1") (compat "30.0.2.0"))
;; SPDX-License-Identifier: GPL-3.0-or-later
;; This file is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; by the Free Software Foundation, either version 3 of the License,
;; or (at your option) any later version.
;;
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this file. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This package implements a macro named `##', which provides a compact way
;; to write short `lambda' expressions.
;; The signature of the macro is (## FN &rest BODY) and it expands to a
;; `lambda' expression, which calls the function FN with the arguments BODY
;; and returns the value of that. The arguments of the `lambda' expression
;; are derived from symbols found in BODY.
;; Each symbol from `%1' through `%9', which appears in an unquoted part
;; of BODY, specifies a mandatory argument. Each symbol from `&1' through
;; `&9', which appears in an unquoted part of BODY, specifies an optional
;; argument. The symbol `&*' specifies extra (`&rest') arguments.
;; The shorter symbol `%' can be used instead of `%1', but using both in
;; the same expression is not allowed. Likewise `&' can be used instead
;; of `&1'. These shorthands are not recognized in function position.
;; To support binding forms that use a vector as VARLIST (such as `-let'
;; from the `dash' package), argument symbols are also detected inside of
;; vectors.
;; The space between `##' and FN can be omitted because `##' is read-syntax
;; for the symbol whose name is the empty string. If you prefer you can
;; place a space there anyway, and if you prefer to not use this somewhat
;; magical symbol at all, you can instead use the alternative name `llama'.
;; Instead of:
;;
;; (lambda (a &optional _ c &rest d)
;; (foo a (bar c) d))
;;
;; you can use this macro and write:
;;
;; (##foo %1 (bar &3) &*)
;;
;; which expands to:
;;
;; (lambda (%1 &optional _&2 &3 &rest &*)
;; (foo %1 (bar &3) &*))
;; Unused trailing arguments and mandatory unused arguments at the border
;; between mandatory and optional arguments are also supported:
;;
;; (##list %1 _%3 &5 _&6)
;;
;; becomes:
;;
;; (lambda (%1 _%2 _%3 &optional _&4 &5 _&6)
;; (list %1 &5))
;;
;; Note how `_%3' and `_&6' are removed from the body, because their names
;; begin with an underscore. Also note that `_&4' is optional, unlike the
;; explicitly specified `_%3'.
;;; Code:
(require 'compat)
;;;###autoload
(defmacro llama (fn &rest body)
"Expand to a `lambda' expression that wraps around FN and BODY.
This macro provides a compact way to write short `lambda' expressions.
It expands to a `lambda' expression, which calls the function FN with
arguments BODY and returns its value. The arguments of the `lambda'
expression are derived from symbols found in BODY.
Each symbol from `%1' through `%9', which appears in an unquoted part
of BODY, specifies a mandatory argument. Each symbol from `&1' through
`&9', which appears in an unquoted part of BODY, specifies an optional
argument. The symbol `&*' specifies extra (`&rest') arguments.
The shorter symbol `%' can be used instead of `%1', but using both in
the same expression is not allowed. Likewise `&' can be used instead
of `&1'. These shorthands are not recognized in function position.
To support binding forms that use a vector as VARLIST (such as `-let'
from the `dash' package), argument symbols are also detected inside of
vectors.
The space between `##' and FN can be omitted because `##' is read-syntax
for the symbol whose name is the empty string. If you prefer you can
place a space there anyway, and if you prefer to not use this somewhat
magical symbol at all, you can instead use the alternative name `llama'.
Instead of:
(lambda (a &optional _ c &rest d)
(foo a (bar c) d))
you can use this macro and write:
(##foo %1 (bar &3) &*)
which expands to:
(lambda (%1 &optional _&2 &3 &rest &*)
(foo %1 (bar &3) &*))
Unused trailing arguments and mandatory unused arguments at the border
between mandatory and optional arguments are also supported:
(##list %1 _%3 &5 _&6)
becomes:
(lambda (%1 _%2 _%3 &optional _&4 &5 _&6)
(list %1 &5))
Note how `_%3' and `_&6' are removed from the body, because their names
begin with an underscore. Also note that `_&4' is optional, unlike the
explicitly specified `_%3'."
(cond ((symbolp fn))
((and (eq (car-safe fn) backquote-backquote-symbol)
(not body))
(setq body (cdr fn))
(setq fn backquote-backquote-symbol))
((signal 'wrong-type-argument
(list 'symbolp backquote-backquote-symbol fn))))
(let* ((args (make-vector 10 nil))
(body (cdr (llama--collect (cons fn body) args)))
(rest (aref args 0))
(args (nreverse (cdr (append args nil))))
(args (progn (while (and args (null (car args)))
(setq args (cdr args)))
args))
(pos (length args))
(opt nil)
(args (mapcar
(lambda (arg)
(if arg
(setq opt (string-match-p "\\`_?&" (symbol-name arg)))
(setq arg (intern (format "_%c%s" (if opt ?& ?%) pos))))
(setq pos (1- pos))
arg)
args))
(opt nil)
(args (mapcar
(lambda (symbol)
(cond
((string-match-p "\\`_?%" (symbol-name symbol))
(when opt
(error "`%s' cannot follow optional arguments" symbol))
(list symbol))
(opt
(list symbol))
((setq opt t)
(list '&optional symbol))))
(nreverse args))))
`(lambda
(,@(apply #'nconc args)
,@(and rest (list '&rest rest)))
(,fn ,@body))))
(defalias (intern "") 'llama)
(defalias '\#\# 'llama)
(defconst llama--unused-argument (make-symbol "llama--unused-argument"))
(defun llama--collect (expr args &optional fnpos backquoted unquote)
(cond
((memq (car-safe expr) (list (intern "") 'llama 'quote)) expr)
((and backquoted (symbolp expr)) expr)
((and backquoted
(memq (car-safe expr)
(list backquote-unquote-symbol
backquote-splice-symbol)))
(list (car expr)
(llama--collect (cadr expr) args nil nil t)))
((memq (car-safe expr)
(list backquote-backquote-symbol
backquote-splice-symbol))
(list (car expr)
(llama--collect (cadr expr) args nil t)))
((symbolp expr)
(let ((name (symbol-name expr)))
(save-match-data
(cond
((string-match "\\`\\(_\\)?[%&]\\([1-9*]\\)?\\'" name)
(let* ((pos (match-string 2 name))
(pos (cond ((equal pos "*") 0)
((not pos) 1)
((string-to-number pos))))
(sym (aref args pos)))
(unless (and fnpos (not unquote) (memq expr '(% &)))
(when (and sym (not (equal expr sym)))
(error "`%s' and `%s' are mutually exclusive" sym expr))
(aset args pos expr)))
(if (match-string 1 name)
llama--unused-argument
expr))
(expr)))))
((or (listp expr)
(vectorp expr))
(let* ((vectorp (vectorp expr))
(expr (if vectorp (append expr ()) expr))
(fnpos (and (not vectorp)
(not backquoted)
(ignore-errors (length expr)))) ;proper-list-p
(ret ()))
(catch t
(while t
(let ((elt (llama--collect (car expr) args fnpos backquoted)))
(unless (eq elt llama--unused-argument)
(push elt ret)))
(setq fnpos nil)
(setq expr (cdr expr))
(unless (and expr
(listp expr)
(not (eq (car expr) backquote-unquote-symbol)))
(throw t nil))))
(setq ret (nreverse ret))
(when expr
(setcdr (last ret) (llama--collect expr args nil backquoted)))
(if vectorp (vconcat ret) ret)))
(expr)))
;;; Advices
(define-advice elisp--expect-function-p (:around (fn pos) llama)
"Support function completion directly following `##'."
(or (and (eq (char-before pos) ?#)
(eq (char-before (- pos 1)) ?#))
(and (eq (char-before pos) ?\s)
(eq (char-before (- pos 1)) ?#)
(eq (char-before (- pos 2)) ?#))
(funcall fn pos)))
(define-advice elisp-mode-syntax-propertize (:override (start end) llama)
;; Synced with Emacs up to 6b9510d94f814cacf43793dce76250b5f7e6f64a.
"Like `elisp-mode-syntax-propertize' but don't change syntax of `##'."
(goto-char start)
(let ((case-fold-search nil))
(funcall
(syntax-propertize-rules
;; Empty symbol.
;; {{ Comment out to prevent the `##' from becoming part of
;; the following symbol when there is no space in between.
;; ("##" (0 (unless (nth 8 (syntax-ppss))
;; (string-to-syntax "_"))))
;; }}
;; {{ As for other symbols, use `font-lock-constant-face' in
;; docstrings and comments.
("##" (0 (when (nth 8 (syntax-ppss))
(string-to-syntax "_"))))
;; }}
;; {{ Preserve this part, even though it is absent from
;; this function in 29.1; backporting it by association.
;; Prevent the @ from becoming part of a following symbol.
(",@" (0 (unless (nth 8 (syntax-ppss))
(string-to-syntax "'"))))
;; }}
;; Unicode character names. (The longest name is 88 characters
;; long.)
("\\?\\\\N{[-A-Za-z0-9 ]\\{,100\\}}"
(0 (unless (nth 8 (syntax-ppss))
(string-to-syntax "_"))))
((rx "#" (or (seq (group-n 1 "&" (+ digit)) ?\") ; Bool-vector.
(seq (group-n 1 "s") "(") ; Record.
(seq (group-n 1 (+ "^")) "["))) ; Char-table.
(1 (unless (save-excursion (nth 8 (syntax-ppss (match-beginning 0))))
(string-to-syntax "'")))))
start end)))
(define-advice all-completions (:around (fn str table &rest rest) llama)
"Remove empty symbol from completion results if originating from `llama'.
`##' is the notation for the symbol whose name is the empty string.
(intern \"\") => ##
(symbol-name \\='##) => \"\"
The `llama' package uses `##' as the name of a macro, which allows
it to be used akin to syntax, without actually being new syntax.
\(`describe-function' won't let you select `##', but because that is an
alias for `llama', you can access the documentation under that name.)
This advice prevents the empty string from being offered as a completion
candidate when `obarray' or a completion table that internally uses
that is used as TABLE."
(let ((result (apply fn str table rest)))
(if (and (eq obarray table) (equal str ""))
(delete "" result)
result)))
(defvar llama-fontify-mode)
(define-advice lisp--el-match-keyword (:override (limit) llama -80)
(catch 'found
(while (re-search-forward
(concat (if llama-fontify-mode
"(\\(?:## ?\\)?\\("
"(\\(")
(static-if (get 'lisp-mode-symbol 'rx-definition) ;>= 29.1
(rx lisp-mode-symbol)
lisp-mode-symbol-regexp)
"\\)\\_>")
limit t)
(let ((sym (intern-soft (match-string 1))))
(when (and (or (special-form-p sym)
(macrop sym)
;; Same as in advice of `morlock' package.
(get sym 'morlock-font-lock-keyword))
(not (get sym 'no-font-lock-keyword))
(static-if (fboundp 'lisp--el-funcall-position-p) ;>= 28.1
(lisp--el-funcall-position-p (match-beginning 0))
(not (lisp--el-non-funcall-position-p
(match-beginning 0)))))
(throw 'found t))))))
;;; Fontification
(defgroup llama ()
"Compact syntax for short lambda."
:group 'extensions
:group 'lisp)
(defface llama-\#\#-macro '((t :inherit font-lock-function-call-face))
"Face used for the name of the `##' macro.")
(defface llama-llama-macro '((t :inherit font-lock-keyword-face))
"Face used for the name of the `llama' macro.")
(defface llama-mandatory-argument '((t :inherit font-lock-variable-use-face))
"Face used for mandatory arguments `%1' through `%9' and `%'.")
(defface llama-optional-argument '((t :inherit font-lock-type-face))
"Face used for optional arguments `&1' through `&9', `&' and `&*'.")
(defface llama-deleted-argument
`((((supports :box t))
:box ( :line-width ,(if (>= emacs-major-version 28) (cons -1 -1) -1)
:color "red"
:style nil))
(((supports :underline t))
:underline "red")
(t
:inherit font-lock-warning-face))
"Face used for deleted arguments `_%1'...`_%9', `_&1'...`_&9' and `_&*'.
This face is used in addition to one of llama's other argument faces.
Unlike implicit unused arguments (which do not appear in the function
body), these arguments are deleted from the function body during macro
expansion, and the looks of this face should hint at that.")
(defconst llama-font-lock-keywords-28
'(("(\\(##\\)" 1 'llama-\#\#-macro)
("(\\(llama\\)\\_>" 1 'llama-llama-macro)
("\\_<\\(?:_?%[1-9]?\\)\\_>"
0 (llama--maybe-face 'llama-mandatory-argument))
("\\_<\\(?:_?&[1-9*]?\\)\\_>"
0 (llama--maybe-face 'llama-optional-argument))
("\\_<\\(?:_\\(?:%[1-9]?\\|&[1-9*]?\\)\\)\\_>"
0 'llama-deleted-argument prepend)))
(defconst llama-font-lock-keywords-29
`(("\\_<\\(&[1-9*]?\\)\\_>" 1 'default)
(,(apply-partially #'llama--match-and-fontify "(\\(##\\)")
1 'llama-\#\#-macro)
(,(apply-partially #'llama--match-and-fontify "(\\(llama\\_>\\)")
1 'llama-llama-macro)))
(defvar llama-font-lock-keywords
(if (fboundp 'read-positioning-symbols)
llama-font-lock-keywords-29
llama-font-lock-keywords-28))
(defun llama--maybe-face (face)
(and (not (and (member (match-string 0) '("%" "&"))
(and-let* ((beg (ignore-errors
(scan-lists (match-beginning 0) -1 1))))
(string-match-p "\\`\\(##\\|llama\\_>\\)?[\s\t\n\r]*\\'"
(buffer-substring-no-properties
(1+ beg) (match-beginning 0))))))
face))
(defun llama--match-and-fontify (re end)
(static-if (fboundp 'bare-symbol)
(and (re-search-forward re end t)
(prog1 t
(save-excursion
(goto-char (match-beginning 0))
(when-let (((save-match-data (not (nth 8 (syntax-ppss)))))
(expr (ignore-errors
(read-positioning-symbols (current-buffer)))))
(put-text-property (match-beginning 0) (point)
'font-lock-multiline t)
(llama--fontify (cdr expr) nil nil t)))))
(list re end))) ; Silence compiler.
(defun llama--fontify (expr &optional fnpos backquoted top)
(static-if (fboundp 'bare-symbol)
(cond
((null expr) expr)
((eq (car-safe expr) 'quote))
((eq (ignore-errors (bare-symbol (car-safe expr))) 'quote))
((and (memq (ignore-errors (bare-symbol (car-safe expr)))
(list (intern "") 'llama))
(not top)))
((and backquoted (symbol-with-pos-p expr)))
((and backquoted
(memq (car-safe expr)
(list backquote-unquote-symbol
backquote-splice-symbol)))
(llama--fontify expr))
((symbol-with-pos-p expr)
(save-match-data
(when-let*
((name (symbol-name (bare-symbol expr)))
(face (cond
((and (string-match
"\\_<\\(?:\\(_\\)?%\\([1-9]\\)?\\)\\_>" name)
(or (not fnpos) (match-end 2)))
'llama-mandatory-argument)
((and (string-match
"\\_<\\(?:\\(_\\)?&\\([1-9*]\\)?\\)\\_>" name)
(or (not fnpos) (match-end 2)))
'llama-optional-argument))))
(when (match-end 1)
(setq face (list 'llama-deleted-argument face)))
(let ((beg (symbol-with-pos-pos expr)))
(put-text-property
beg (save-excursion (goto-char beg) (forward-symbol 1))
'face face)))))
((or (listp expr)
(vectorp expr))
(let* ((vectorp (vectorp expr))
(expr (if vectorp (append expr ()) expr))
(fnpos (and (not vectorp)
(not backquoted)
(ignore-errors (length expr)))))
(catch t
(while t
(cond ((eq (car expr) backquote-backquote-symbol)
(setq expr (cdr expr))
(llama--fontify (car expr) t t))
((llama--fontify (car expr) fnpos backquoted)))
(setq fnpos nil)
(setq expr (cdr expr))
(unless (and expr
(listp expr)
(not (eq (car expr) backquote-unquote-symbol)))
(throw t nil))))
(when expr
(llama--fontify expr fnpos))))))
(list expr fnpos backquoted top)) ; Silence compiler.
(defvar llama-fontify-mode-lighter nil)
;;;###autoload
(define-minor-mode llama-fontify-mode
"Toggle fontification of the `##' macro and its positional arguments."
:lighter llama-fontify-mode-lighter
(if llama-fontify-mode
(font-lock-add-keywords nil llama-font-lock-keywords)
(font-lock-remove-keywords nil llama-font-lock-keywords)))
(defun llama--turn-on-fontify-mode ()
"Enable `llama-fontify-mode' if in an Emacs Lisp buffer."
(when (derived-mode-p #'emacs-lisp-mode)
(llama-fontify-mode)))
;;;###autoload
(define-globalized-minor-mode global-llama-fontify-mode
llama-fontify-mode llama--turn-on-fontify-mode)
;;; Partial applications
(defun llama--left-apply-partially (fn &rest args)
"Return a function that is a partial application of FN to ARGS.
ARGS is a list of the first N arguments to pass to FN. The result
is a new function which does the same as FN, except that the first N
arguments are fixed at the values with which this function was called.
See also `llama--right-apply-partially', which instead fixes the last
N arguments.
These functions are intended to be used using the names `partial' and
`rpartial'. To be able to use these shorthands in a file, you must set
the file-local value of `read-symbols-shorthands', which was added in
Emacs 28.1. For an example see the end of file \"llama.el\".
This is an alternative to `apply-partially', whose name is too long."
(declare (pure t) (side-effect-free error-free))
(lambda (&rest args2)
(apply fn (append args args2))))
(defun llama--right-apply-partially (fn &rest args)
"Return a function that is a right partial application of FN to ARGS.
ARGS is a list of the last N arguments to pass to FN. The result
is a new function which does the same as FN, except that the last N
arguments are fixed at the values with which this function was called.
See also `llama--left-apply-partially', which instead fixes the first
N arguments.
These functions are intended to be used using the names `rpartial' and
`partial'. To be able to use these shorthands in a file, you must set
the file-local value of `read-symbols-shorthands', which was added in
Emacs 28.1. For an example see the end of file \"llama.el\"."
(declare (pure t) (side-effect-free error-free))
(lambda (&rest args2)
(apply fn (append args2 args))))
;; An example of how one would use these functions:
;;
;; (list (funcall (partial (lambda (a b) (list a b)) 'fixed) 'after)
;; (funcall (rpartial (lambda (a b) (list a b)) 'fixed) 'before))
;; An example of the configuration that is necessary to enable this:
;;
;; Local Variables:
;; indent-tabs-mode: nil
;; read-symbol-shorthands: (
;; ("partial" . "llama--left-apply-partially")
;; ("rpartial" . "llama--right-apply-partially"))
;; End:
;;
;; Do not set `read-symbol-shorthands' in the ".dir-locals.el"
;; file, because that does not work for uncompiled libraries.
(provide 'llama)
;;; llama.el ends here
+3 -3
View File
@@ -1,9 +1,9 @@
(define-package "magit-section" "20250221.105" "Sections for read-only buffers"
(define-package "magit-section" "20250307.1739" "Sections for read-only buffers"
'((emacs "27.1")
(compat "30.0.2.0")
(llama "0.6.0")
(llama "0.6.1")
(seq "2.24"))
:commit "3ad94012b0f570809c52eb3323fa1436e180984e" :authors
:commit "3f79700f1b9a6f5f6fd6a77fd1e812c1b8e6463b" :authors
'(("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev"))
:maintainers
'(("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev"))
+51 -49
View File
@@ -8,11 +8,11 @@
;; Homepage: https://github.com/magit/magit
;; Keywords: tools
;; Package-Version: 4.3.0
;; Package-Version: 4.3.1
;; Package-Requires: (
;; (emacs "27.1")
;; (compat "30.0.2.0")
;; (llama "0.6.0")
;; (llama "0.6.1")
;; (seq "2.24"))
;; SPDX-License-Identifier: GPL-3.0-or-later
@@ -396,8 +396,7 @@ no effect. This also has no effect for Emacs >= 28, where
(defvar-keymap magit-section-heading-map
:doc "Keymap used in the heading line of all expandable sections.
This keymap is used in addition to the section-specific keymap,
if any."
This keymap is used in addition to the section-specific keymap, if any."
"<double-down-mouse-1>" #'ignore
"<double-mouse-1>" #'magit-mouse-toggle-section
"<double-mouse-2>" #'magit-mouse-toggle-section)
@@ -1392,7 +1391,7 @@ anything this time around.
(pcase-let* ((bind (and (symbolp (car args))
(pop args)))
(`((,class ,value ,hide . ,args) . ,body) args)
(obj (cl-gensym "section")))
(obj (gensym "section")))
`(let* ((,obj (magit-insert-section--create
,(if (eq (car-safe class) 'eval) (cadr class) `',class)
,value ,hide ,@args))
@@ -1448,47 +1447,33 @@ anything this time around.
(defun magit-insert-section--finish (obj)
(run-hooks 'magit-insert-section-hook)
(let ((beg (oref obj start))
(end (oset obj end
(if magit-section-inhibit-markers
(point)
(point-marker))))
(props `( magit-section ,obj
,@(and-let* ((map (symbol-value (oref obj keymap))))
(list 'keymap map)))))
(unless magit-section-inhibit-markers
(set-marker-insertion-type beg t))
(cond ((eq obj magit-root-section))
((oref obj children)
(magit-insert-child-count obj)
(magit-section-maybe-add-heading-map obj)
(save-excursion
(goto-char beg)
(while (< (point) end)
(let ((next (or (next-single-property-change
(point) 'magit-section)
end)))
(unless (magit-section-at)
(add-text-properties (point) next props))
(goto-char next)))))
((add-text-properties beg end props)))
(cond ((eq obj magit-root-section)
(when (eq magit-section-inhibit-markers 'delay)
(setq magit-section-inhibit-markers nil)
(magit-map-sections
(lambda (section)
(oset section start (copy-marker (oref section start) t))
(oset section end (copy-marker (oref section end) t)))))
(let ((magit-section-cache-visibility nil))
(magit-section-show obj)))
(magit-section-insert-in-reverse
(push obj (oref (oref obj parent) children)))
((let ((parent (oref obj parent)))
(oset parent children
(nconc (oref parent children)
(list obj))))))
(when magit-section-insert-in-reverse
(oset obj children (nreverse (oref obj children))))))
(if magit-section-inhibit-markers
(oset obj end (point))
(oset obj end (point-marker))
(set-marker-insertion-type (oref obj start) t))
(cond
((eq obj magit-root-section)
(when (eq magit-section-inhibit-markers 'delay)
(setq magit-section-inhibit-markers nil)
(magit-map-sections
(lambda (section)
(oset section start (copy-marker (oref section start) t))
(oset section end (copy-marker (oref section end) t)))))
(let ((magit-section-cache-visibility nil))
(magit-section-show obj)))
(t
(magit-section--set-section-properties obj)
(magit-section-maybe-add-heading-map obj)
(when (oref obj children)
(magit-insert-child-count obj))
(if magit-section-insert-in-reverse
(push obj (oref (oref obj parent) children))
(let ((parent (oref obj parent)))
(oset parent children
(nconc (oref parent children)
(list obj)))))))
(when magit-section-insert-in-reverse
(oset obj children (nreverse (oref obj children)))))
(defun magit-cancel-section (&optional if-empty)
"Cancel inserting the section that is currently being inserted.
@@ -1574,9 +1559,9 @@ If the section is expanded when it is created, then this is
like `progn'. Otherwise BODY isn't evaluated until the section
is explicitly expanded."
(declare (indent 0))
(let ((f (cl-gensym))
(s (cl-gensym))
(l (cl-gensym)))
(let ((f (gensym))
(s (gensym))
(l (gensym)))
`(let ((,f (lambda () ,@body)))
(if (oref magit-insert-section--current hidden)
(oset magit-insert-section--current washer
@@ -1588,6 +1573,7 @@ is explicitly expanded."
(funcall ,f)
(dolist (s ,l)
(set-marker-insertion-type (oref s end) nil))
(magit-section--set-section-properties ,s)
(magit-section-maybe-remove-heading-map ,s)
(magit-section-maybe-remove-visibility-indicator ,s)))))
(funcall ,f)))))
@@ -1615,6 +1601,22 @@ is explicitly expanded."
(magit-section-maybe-add-heading-map 1st-header)))))
(remove-hook 'magit-insert-section-hook fn t))))
(defun magit-section--set-section-properties (section)
(pcase-let* (((eieio start end children keymap) section)
(props `( magit-section ,section
,@(and-let* ((map (symbol-value keymap)))
(list 'keymap map)))))
(if children
(save-excursion
(goto-char start)
(while (< (point) end)
(let ((next (or (next-single-property-change (point) 'magit-section)
end)))
(unless (magit-section-at)
(add-text-properties (point) next props))
(goto-char next))))
(add-text-properties start end props))))
(defun magit-section-maybe-add-heading-map (section)
(when (magit-section-content-p section)
(let ((start (oref section start))
+19 -19
View File
@@ -1,4 +1,4 @@
This is magit-section.info, produced by makeinfo version 6.8 from
This is magit-section.info, produced by makeinfo version 7.1.1 from
magit-section.texi.
Copyright (C) 2015-2025 Jonas Bernoulli
@@ -34,7 +34,7 @@ packages that have nothing to do with Magit or Git.
and user options see *note (magit)Sections::. This manual documents how
you can use sections in your own packages.
This manual is for Magit-Section version 4.3.0.
This manual is for Magit-Section version 4.3.1.
Copyright (C) 2015-2025 Jonas Bernoulli
<emacs.magit@jonas.bernoulli.dev>
@@ -85,17 +85,17 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev
body
Create a section object of type CLASS, storing VALUE in its value
slot, and insert the section at point. CLASS is a subclass of
magit-section or has the form (eval FORM), in which case FORM
'magit-section' or has the form (eval FORM), in which case FORM
is evaluated at runtime and should return a subclass. In other
places a sections class is often referred to as its "type".
Many commands behave differently depending on the class of the
current section and sections of a certain class can have their own
keymap, which is specified using the keymap class slot. The
keymap, which is specified using the 'keymap' class slot. The
value of that slot should be a variable whose value is a keymap.
For historic reasons Magit and Forge in most cases use symbols as
CLASS that dont actually identify a class and that lack the
CLASS that don't actually identify a class and that lack the
appropriate package prefix. This works due to some undocumented
kludges, which are not available to other packages.
@@ -106,19 +106,19 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev
during a refresh, then the visibility of predecessor is inherited
and HIDE is ignored (but the hook is still honored).
BODY is any number of forms that actually insert the sections
BODY is any number of forms that actually insert the section's
heading and body. Optional NAME, if specified, has to be a symbol,
which is then bound to the object of the section being inserted.
Before BODY is evaluated the start of the section object is set
to the value of point and after BODY was evaluated its end is
to the value of 'point' and after BODY was evaluated its end is
set to the new value of point; BODY is responsible for moving
point forward.
If it turns out inside BODY that the section is empty, then
magit-cancel-section can be used to abort and remove all traces
of the partially inserted section. This can happen when creating a
section by washing Gits output and Git didnt actually output
section by washing Git's output and Git didn't actually output
anything this time around.
-- Function: magit-insert-heading [child-count] &rest args
@@ -136,7 +136,7 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev
any text before this happens and afterwards it should again only
contain a single line. If the face property is set anywhere
inside any of these strings, then insert all of them unchanged.
Otherwise use the magit-section-heading face for all inserted
Otherwise use the 'magit-section-heading' face for all inserted
text.
The content property of the section object is the end of the
@@ -145,7 +145,7 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev
value of content is nil, then the section has no heading and its
body cannot be collapsed. If a section does have a heading, then
its height must be exactly one line, including a trailing newline
character. This isnt enforced, you are responsible for getting it
character. This isn't enforced, you are responsible for getting it
right. The only exception is that this function does insert a
newline character if necessary.
@@ -159,7 +159,7 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev
-- Macro: magit-insert-section-body &rest body
Use BODY to insert the section body, once the section is expanded.
If the section is expanded when it is created, then this is like
progn. Otherwise BODY isnt evaluated until the section is
progn. Otherwise BODY isn't evaluated until the section is
explicitly expanded.
-- Function: magit-cancel-section
@@ -254,13 +254,13 @@ File: magit-section.info, Node: Matching Functions, Prev: Core Functions, Up:
CONDITION can take the following forms:
(CONDITION...) matches if any of the CONDITIONs matches.
[CLASS...] matches if the sections class is the same as the
first CLASS or a subclass of that; the sections parent class
[CLASS...] matches if the section's class is the same as the
first CLASS or a subclass of that; the section's parent class
matches the second CLASS; and so on.
[* CLASS...] matches sections that match [CLASS...] and also
recursively all their child sections.
CLASS matches if the sections class is the same as CLASS or
CLASS matches if the section's class is the same as CLASS or
a subclass of that; regardless of the classes of the parent
sections.
@@ -303,11 +303,11 @@ File: magit-section.info, Node: Matching Functions, Prev: Core Functions, Up:

Tag Table:
Node: Top808
Node: Introduction2109
Node: Creating Sections2879
Node: Core Functions7812
Node: Matching Functions10964
Node: Top810
Node: Introduction2111
Node: Creating Sections2881
Node: Core Functions7786
Node: Matching Functions10938

End Tag Table
+1
View File
@@ -103,6 +103,7 @@ All Contributors
- Clément Pit-Claudel
- Cornelius Mika
- Craig Andera
- Curt Brune
- Daanturo
- Dale Hagglund
- Damien Cassou
+26 -26
View File
@@ -378,32 +378,32 @@ ignored) files."
"--" plain)
(when magit-auto-revert-mode
(mapc #'magit-turn-on-auto-revert-mode-if-desired plain)))
(dolist (repo repos)
(save-excursion
(goto-char (oref (magit-get-section
`((file . ,repo) (untracked) (status)))
start))
(when (and (fboundp 'borg-assimilate)
(fboundp 'borg--maybe-absorb-gitdir)
(fboundp 'borg--sort-submodule-sections))
(let* ((topdir (magit-toplevel))
(url (let ((default-directory
(file-name-as-directory (expand-file-name repo))))
(or (magit-get "remote" (magit-get-some-remote) "url")
(concat (file-name-as-directory ".") repo))))
(package
(and (equal borg-user-emacs-directory topdir)
(file-name-nondirectory (directory-file-name repo)))))
(if (and package
(y-or-n-p (format "Also assimilate `%s' drone?" package)))
(borg-assimilate package url)
(magit-submodule-add-1
url repo (magit-submodule-read-name-for-path repo package))
(when package
(borg--sort-submodule-sections
(expand-file-name ".gitmodules" topdir))
(let ((default-directory borg-user-emacs-directory))
(borg--maybe-absorb-gitdir package))))))))
(when (and (fboundp 'borg-assimilate)
(fboundp 'borg--maybe-absorb-gitdir)
(fboundp 'borg--sort-submodule-sections))
(dolist (repo repos)
(save-excursion
(when-let ((section (magit-get-section
`((file . ,repo) (untracked) (status)))))
(goto-char (oref section start))
(let* ((topdir (magit-toplevel))
(url (let ((default-directory
(file-name-as-directory (expand-file-name repo))))
(or (magit-get "remote" (magit-get-some-remote) "url")
(concat (file-name-as-directory ".") repo))))
(package
(and (equal borg-user-emacs-directory topdir)
(file-name-nondirectory (directory-file-name repo)))))
(if (and package
(y-or-n-p (format "Also assimilate `%s' drone?" package)))
(borg-assimilate package url)
(magit-submodule-add-1
url repo (magit-submodule-read-name-for-path repo package))
(when package
(borg--sort-submodule-sections
(expand-file-name ".gitmodules" topdir))
(let ((default-directory borg-user-emacs-directory))
(borg--maybe-absorb-gitdir package)))))))))
(magit-wip-commit-after-apply files " after stage")))
(defvar magit-post-stage-hook-commands
+10 -10
View File
@@ -129,11 +129,11 @@ The value has the form ((COMMAND nil|PROMPT DEFAULT)...).
:group 'magit-commands
:type '(repeat
(list (symbol :tag "Command") ; It might not be fboundp yet.
(choice (const :tag "for all prompts" nil)
(regexp :tag "for prompts matching regexp"))
(choice (const :tag "offer other choices" nil)
(const :tag "require confirmation" ask)
(const :tag "use default without confirmation" t)))))
(choice (const :tag "For all prompts" nil)
(regexp :tag "For prompts matching regexp"))
(choice (const :tag "Offer other choices" nil)
(const :tag "Require confirmation" ask)
(const :tag "Use default without confirmation" t)))))
(defconst magit--confirm-actions
'((const discard)
@@ -329,7 +329,7 @@ Various:
Global settings:
Instead of adding all of the above symbols to the value of this
option you can also set it to the atom t, which has the same
option you can also set it to the atom `t', which has the same
effect as adding all of the above symbols. Doing that most
certainly is a bad idea, especially because other symbols might
be added in the future. So even if you don't want to be asked
@@ -467,9 +467,9 @@ and delay of your graphical environment or operating system."
`woman' View the respective man-page using the `woman' package."
:package-version '(magit . "2.9.0")
:group 'magit-miscellaneous
:type '(choice (const :tag "view info manual" info)
(const :tag "view manpage using `man'" man)
(const :tag "view manpage using `woman'" woman)))
:type '(choice (const :tag "View info manual" info)
(const :tag "View manpage using `man'" man)
(const :tag "View manpage using `woman'" woman)))
;;; Section Classes
@@ -908,7 +908,7 @@ data, starting with 1 and incrementing by 1 for each symbol. If
the last match was against a string, then that has to be provided
as STRING."
(declare (indent 2) (debug (listp form body)))
(let ((s (cl-gensym "string"))
(let ((s (gensym "string"))
(i 0))
`(let ((,s ,string))
(let ,(save-match-data
+10 -10
View File
@@ -38,17 +38,17 @@
(defcustom magit-branch-read-upstream-first t
"Whether to read upstream before name of new branch when creating a branch.
nil Read the branch name first.
t Read the upstream first.
`nil' Read the branch name first.
`t' Read the upstream first.
`fallback' Read the upstream first, but if it turns out that the chosen
value is not a valid upstream (because it cannot be resolved
as an existing revision), then treat it as the name of the
new branch and continue by reading the upstream next."
:package-version '(magit . "2.2.0")
:group 'magit-commands
:type '(choice (const :tag "read branch name first" nil)
(const :tag "read upstream first" t)
(const :tag "read upstream first, with fallback" fallback)))
:type '(choice (const :tag "Read branch name first" nil)
(const :tag "Read upstream first" t)
(const :tag "Read upstream first, with fallback" fallback)))
(defcustom magit-branch-prefer-remote-upstream nil
"Whether to favor remote upstreams when creating new branches.
@@ -154,10 +154,10 @@ However, I recommend that you use local branches as UPSTREAM."
:package-version '(magit . "2.9.0")
:group 'magit-commands
:type '(repeat (cons (string :tag "Use upstream")
(choice :tag "for branches"
(regexp :tag "matching")
(repeat :tag "except"
(string :tag "branch"))))))
(choice :tag "For branches" ;???
(regexp :tag "Matching")
(repeat :tag "Except"
(string :tag "Branch"))))))
(defcustom magit-branch-rename-push-target t
"Whether the push-remote setup is preserved when renaming a branch.
@@ -177,7 +177,7 @@ When t, then rename the branch named OLD on the remote specified
remote and unless NEW already exists on the remote.
When `forge-only' and the `forge' package is available, then
behave like t if the remote points to a repository on a forge
behave like `t' if the remote points to a repository on a forge
(currently Github or Gitlab), otherwise like `local-only'."
:package-version '(magit . "2.90.0")
:group 'magit-commands
+6 -6
View File
@@ -43,9 +43,9 @@ If t, then set without asking. If nil, then don't set. If
`ask', then ask."
:package-version '(magit . "2.4.0")
:group 'magit-commands
:type '(choice (const :tag "set" t)
(const :tag "ask" ask)
(const :tag "don't set" nil)))
:type '(choice (const :tag "Set" t)
(const :tag "Ask" ask)
(const :tag "Don't set" nil)))
(defcustom magit-clone-default-directory nil
"Default directory to use when `magit-clone' reads destination.
@@ -54,9 +54,9 @@ If a directory, then use that. If a function, then call that
with the remote url as only argument and use the returned value."
:package-version '(magit . "2.90.0")
:group 'magit-commands
:type '(choice (const :tag "value of default-directory")
(directory :tag "constant directory")
(function :tag "function's value")))
:type '(choice (const :tag "Value of default-directory")
(directory :tag "Constant directory")
(function :tag "Function's value")))
(defcustom magit-clone-always-transient nil
"Whether `magit-clone' always acts as a transient prefix command.
+4 -1
View File
@@ -148,7 +148,10 @@ Also see https://github.com/magit/magit/issues/4132."
("W" "Revise" magit-commit-revise)]
["Edit and rebase"
("F" "Instant fixup" magit-commit-instant-fixup)
("S" "Instant squash" magit-commit-instant-squash)]
("S" "Instant squash" magit-commit-instant-squash)
""
""
("R" "Reword past" magit-rebase-reword-commit :level 0)]
["Spread across commits"
("x" "Modified files" magit-commit-autofixup :level 6)
("X" "Updated modules" magit-commit-absorb-modules :level 6)]]
+26 -26
View File
@@ -193,8 +193,8 @@ keep their distinct foreground colors."
(defcustom magit-diff-refine-hunk nil
"Whether to show word-granularity differences within diff hunks.
nil Never show fine differences.
t Show fine differences for the current diff hunk only.
`nil' Never show fine differences.
`t' Show fine differences for the current diff hunk only.
`all' Show fine differences for all displayed diff hunks."
:group 'magit-diff
:safe (lambda (val) (memq val '(nil t all)))
@@ -217,13 +217,13 @@ t Show fine differences for the current diff hunk only.
Determining the correct width can be expensive if it requires
opening large and/or many files, so the widths are cached in
the variable `magit-diff--tab-width-cache'. Set that to nil
the variable `magit-diff--tab-width-cache'. Set that to `nil'
to invalidate the cache.
nil Never adjust tab width. Use `tab-width's value from
`nil' Never adjust tab width. Use `tab-width's value from
the Magit buffer itself instead.
t If the corresponding file-visiting buffer exits, then
`t' If the corresponding file-visiting buffer exits, then
use `tab-width's value from that buffer. Doing this is
cheap, so this value is used even if a corresponding
cache entry exists.
@@ -243,8 +243,8 @@ NUMBER Like `always', but don't visit files larger than NUMBER
(defcustom magit-diff-paint-whitespace t
"Specify where to highlight whitespace errors.
nil Never highlight whitespace errors.
t Highlight whitespace errors everywhere.
`nil' Never highlight whitespace errors.
`t' Highlight whitespace errors everywhere.
`uncommitted' Only highlight whitespace errors in diffs
showing uncommitted changes.
@@ -266,15 +266,15 @@ whitespace errors are highlighted."
(defcustom magit-diff-paint-whitespace-lines t
"Specify in what kind of lines to highlight whitespace errors.
t Highlight only in added lines.
`t' Highlight only in added lines.
`both' Highlight in added and removed lines.
`all' Highlight in added, removed and context lines."
:package-version '(magit . "3.0.0")
:group 'magit-diff
:safe (lambda (val) (memq val '(t both all)))
:type '(choice (const :tag "in added lines" t)
(const :tag "in added and removed lines" both)
(const :tag "in added, removed and context lines" all)))
:type '(choice (const :tag "In added lines" t)
(const :tag "In added and removed lines" both)
(const :tag "In added, removed and context lines" all)))
(defcustom magit-diff-highlight-trailing t
"Whether to highlight whitespace at the end of a line in diffs.
@@ -412,8 +412,8 @@ subject to option `magit-revision-insert-related-refs'."
(defcustom magit-revision-insert-related-refs t
"Whether to show related branches in revision buffers.
nil Don't show any related branches.
t Show related local branches.
`nil' Don't show any related branches.
`t' Show related local branches.
`all' Show related local and remote branches.
`mixed' Show all containing branches and local merged branches.
@@ -421,10 +421,10 @@ See user option `magit-revision-insert-related-refs-display-alist'
to hide specific sets of related branches."
:package-version '(magit . "2.1.0")
:group 'magit-revision
:type '(choice (const :tag "don't" nil)
(const :tag "local only" t)
(const :tag "all related" all)
(const :tag "all containing, local merged" mixed)))
:type '(choice (const :tag "Do not" nil)
(const :tag "Local only" t)
(const :tag "All related" all)
(const :tag "All containing, local merged" mixed)))
(defcustom magit-revision-insert-related-refs-display-alist nil
"How `magit-insert-revision-headers' displays related branch types.
@@ -433,11 +433,11 @@ This is an alist, with recognised keys being the symbols
`parents', `merged', `contained', `follows', and `precedes';
and the supported values for each key being:
nil Hide these related branches.
t Show these related branches.
`nil' Hide these related branches.
`t' Show these related branches.
Keys which are not present in the alist have an implicit value t
\(so the default alist value of nil means all related branch types
Keys which are not present in the alist have an implicit value `t'
\(so the default alist value of `nil' means all related branch types
will be shown.)
The types to be shown are additionally subject to user option
@@ -465,7 +465,7 @@ performance and reliability:
long and which contain at least one number as well as at least
one letter.
If nil, then no hashes are turned into sections, but you can
If `nil', then no hashes are turned into sections, but you can
still visit the commit at point using \"RET\"."
:package-version '(magit . "2.12.0")
:group 'magit-revision
@@ -478,9 +478,9 @@ still visit the commit at point using \"RET\"."
(defcustom magit-revision-show-gravatars nil
"Whether to show gravatar images in revision buffers.
If nil, then don't insert any gravatar images. If t, then insert
both images. If `author' or `committer', then insert only the
respective image.
If `nil', then don't insert any gravatar images. If `t', then
insert both images. If `author' or `committer', then insert
only the respective image.
If you have customized the option `magit-revision-header-format'
and want to insert the images then you might also have to specify
@@ -489,7 +489,7 @@ two regular expressions. The car specifies where to insert the
author's image. The top half of the image is inserted right
after the matched text, the bottom half on the next line in the
same column. The cdr specifies where to insert the committer's
image, accordingly. Either the car or the cdr may be nil."
image, accordingly. Either the car or the cdr may be `nil'."
:package-version '(magit . "2.3.0")
:group 'magit-revision
:type '(choice
+2 -2
View File
@@ -181,8 +181,8 @@ is put in FILE."
(setq get (nreverse get))
(setq make (nreverse make))
(setq kill (nreverse kill))
(let ((mconf (cl-gensym "conf"))
(mfile (cl-gensym "file")))
(let ((mconf (gensym "conf"))
(mfile (gensym "file")))
`(magit-with-toplevel
(let ((,mconf (current-window-configuration))
(,mfile ,file)
+4 -4
View File
@@ -252,8 +252,8 @@ See info node `(magit)Debugging Tools' for more information."
(defmacro magit--with-refresh-cache (key &rest body)
(declare (indent 1) (debug (form body)))
(let ((k (cl-gensym))
(hit (cl-gensym)))
(let ((k (gensym))
(hit (gensym)))
`(if magit--refresh-cache
(let ((,k ,key))
(if-let ((,hit (assoc ,k (cdr magit--refresh-cache))))
@@ -299,7 +299,7 @@ propagated by `with-temp-buffer', so we explicitly ensure that
happens, so that processes will be invoked consistently. BODY is
as for that macro."
(declare (indent 0) (debug (body)))
(let ((p (cl-gensym)))
(let ((p (gensym)))
`(let ((,p process-environment))
(with-temp-buffer
(setq-local process-environment ,p)
@@ -2402,7 +2402,7 @@ and this option only controls what face is used.")
(defmacro magit-with-temp-index (tree arg &rest body)
(declare (indent 2) (debug (form form body)))
(let ((file (cl-gensym "file")))
(let ((file (gensym "file")))
`(let ((magit--refresh-cache nil)
(,file (magit-convert-filename-for-git
(make-temp-name
+4 -4
View File
@@ -262,10 +262,10 @@ The message can be shown in the `echo-area' or the `header-line', or in
be nil, in which case no usage information is shown."
:package-version '(magit . "2.1.0")
:group 'magit-log
:type '(choice (const :tag "in echo-area" echo-area)
(const :tag "in header-line" header-line)
(const :tag "in both places" both)
(const :tag "nowhere")))
:type '(choice (const :tag "In echo-area" echo-area)
(const :tag "In header-line" header-line)
(const :tag "In both places" both)
(const :tag "Nowhere")))
(defcustom magit-log-select-margin
(list (nth 0 magit-log-margin)
+16 -15
View File
@@ -234,10 +234,10 @@ and Buffer Variables'."
:group 'magit-diff
:group 'magit-log
:type '(choice
(const :tag "always use args from buffer" always)
(const :tag "use args from buffer if displayed in frame" selected)
(const :tag "use args from buffer if it is current" current)
(const :tag "never use args from buffer" never)))
(const :tag "Always use args from buffer" always)
(const :tag "Use args from buffer if displayed in frame" selected)
(const :tag "Use args from buffer if it is current" current)
(const :tag "Never use args from buffer" never)))
(defcustom magit-direct-use-buffer-arguments 'selected
"Whether certain commands reuse arguments active in relevant buffer.
@@ -267,10 +267,10 @@ and Buffer Variables'."
:group 'magit-diff
:group 'magit-log
:type '(choice
(const :tag "always use args from buffer" always)
(const :tag "use args from buffer if displayed in frame" selected)
(const :tag "use args from buffer if it is current" current)
(const :tag "never use args from buffer" never)))
(const :tag "Always use args from buffer" always)
(const :tag "Use args from buffer if displayed in frame" selected)
(const :tag "Use args from buffer if it is current" current)
(const :tag "Never use args from buffer" never)))
(defcustom magit-region-highlight-hook
'(magit-diff-update-hunk-region) ; from magit-diff.el
@@ -1142,12 +1142,13 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
(defvar magit-after-save-refresh-buffers nil)
(defun magit-after-save-refresh-buffers ()
(dolist (buffer magit-after-save-refresh-buffers)
(when (buffer-live-p buffer)
(with-current-buffer buffer
(magit-refresh-buffer))))
(setq magit-after-save-refresh-buffers nil)
(remove-hook 'post-command-hook #'magit-after-save-refresh-buffers))
(unless magit-inhibit-refresh
(dolist (buffer magit-after-save-refresh-buffers)
(when (buffer-live-p buffer)
(with-current-buffer buffer
(magit-refresh-buffer))))
(setq magit-after-save-refresh-buffers nil)
(remove-hook 'post-command-hook #'magit-after-save-refresh-buffers)))
(defun magit-after-save-refresh-status ()
"Refresh the status buffer of the current repository.
@@ -1426,7 +1427,7 @@ repositories."
(defmacro magit--with-repository-local-cache (key &rest body)
(declare (indent 1) (debug (form body)))
(let ((k (cl-gensym)))
(let ((k (gensym)))
`(let ((,k ,key))
(if-let ((kv (magit-repository-local-exists-p ,k)))
(cdr kv)
+3 -3
View File
@@ -40,12 +40,12 @@ a constant list of arguments, depending on this option and
the prefix argument."
:package-version '(magit . "2.12.0")
:group 'magit-diff
:type '(choice (const :tag "use buffer arguments" buffer)
(cons :tag "use buffer arguments except"
:type '(choice (const :tag "Use buffer arguments" buffer)
(cons :tag "Use buffer arguments except"
(const :format "" exclude)
(repeat :format "%v%i\n"
(string :tag "Argument")))
(repeat :tag "use constant arguments"
(repeat :tag "Use constant arguments"
(string :tag "Argument"))))
;;; Commands
+5 -5
View File
@@ -1,12 +1,12 @@
(define-package "magit" "20250221.105" "A Git porcelain inside Emacs"
(define-package "magit" "20250305.2342" "A Git porcelain inside Emacs"
'((emacs "27.1")
(compat "30.0.2.0")
(llama "0.6.0")
(magit-section "4.3.0")
(llama "0.6.1")
(magit-section "4.3.1")
(seq "2.24")
(transient "0.8.4")
(transient "0.8.5")
(with-editor "3.4.3"))
:commit "9914feb4d5a2feab091076be554d80781594869d" :authors
:commit "225ea6fd009300ba80e55a0162f3e46eb6e4f2d3" :authors
'(("Marius Vollmer" . "marius.vollmer@gmail.com")
("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev"))
:maintainers
+3 -3
View File
@@ -49,8 +49,8 @@
If nil, use pipes: this is usually more efficient, and works on Cygwin.
If t, use ptys: this enables Magit to prompt for passphrases when needed."
:group 'magit-process
:type '(choice (const :tag "pipe" nil)
(const :tag "pty" t)))
:type '(choice (const :tag "Pipe" nil)
(const :tag "Pty" t)))
(defcustom magit-need-cygwin-noglob
(and (eq system-type 'windows-nt)
@@ -257,7 +257,7 @@ process section in the process buffer, and insert the returned
string in the heading of its section."
:package-version '(magit . "4.0.0")
:group 'magit-process
:type '(choice (const :tag "none" nil) string))
:type '(choice (const :tag "None" nil) string))
(defvar tramp-pipe-stty-settings)
(defvar magit-tramp-pipe-stty-settings ""
+4 -4
View File
@@ -40,10 +40,10 @@ the name of the added remote is equal to that string and the
variable isn't already set."
:package-version '(magit . "2.4.0")
:group 'magit-commands
:type '(choice (const :tag "ask if unset" ask-if-unset)
(const :tag "always ask" ask)
(string :tag "set if named")
(const :tag "don't set")))
:type '(choice (const :tag "Ask if unset" ask-if-unset)
(const :tag "Always ask" ask)
(string :tag "Set if named")
(const :tag "Don't set")))
(defcustom magit-remote-direct-configure t
"Whether the command `magit-remote' shows Git variables.
+2 -2
View File
@@ -560,8 +560,8 @@ This discards all changes made since the sequence started."
("s" "a subset" magit-rebase-subset)]
[("m" "to modify a commit" magit-rebase-edit-commit)
("w" "to reword a commit" magit-rebase-reword-commit)
("k" "to remove a commit" magit-rebase-remove-commit)
("f" "to autosquash" magit-rebase-autosquash)
("k" "to remove a commit" magit-rebase-remove-commit)]
[("f" "to autosquash" magit-rebase-autosquash)
(6 "t" "to change dates" magit-reshelve-since)]]
["Actions"
:if magit-rebase-in-progress-p
+7 -7
View File
@@ -109,9 +109,9 @@ See option `magit-section-initial-visibility-alist' for how to
control the initial visibility of the jumped to section."
:package-version '(magit . "2.90.0")
:group 'magit-status
:type '(choice (const :tag "as usual" nil)
(repeat (choice (number :tag "nth top-level section")
(sexp :tag "section identity")))))
:type '(choice (const :tag "As usual" nil)
(repeat (choice (number :tag "Nth top-level section")
(sexp :tag "Section identity")))))
(defcustom magit-status-goto-file-position nil
"Whether to go to position corresponding to file position.
@@ -237,10 +237,10 @@ Valid values are:
:group 'magit-buffers
:group 'magit-commands
:type '(choice
(const :tag "always use args from buffer" always)
(const :tag "use args from buffer if displayed in frame" selected)
(const :tag "use args from buffer if it is current" current)
(const :tag "never use args from buffer" never)))
(const :tag "Always use args from buffer" always)
(const :tag "Use args from buffer if displayed in frame" selected)
(const :tag "Use args from buffer if it is current" current)
(const :tag "Never use args from buffer" never)))
;;; Commands
+1 -1
View File
@@ -1,6 +1,6 @@
;;; magit-version.el --- the Magit version you are using
(setq magit-version "4.3.0")
(setq magit-version "4.3.1")
(provide 'migit-version)
-33
View File
@@ -40,41 +40,12 @@
:group 'magit-modes
:group 'magit-essentials)
(defgroup magit-wip-legacy nil
"It is better to not use these modes individually."
:link '(info-link "(magit)Legacy Wip Modes")
:group 'magit-wip)
(defcustom magit-wip-mode-lighter " Wip"
"Lighter for Magit-Wip mode."
:package-version '(magit . "2.90.0")
:group 'magit-wip
:type 'string)
(defcustom magit-wip-after-save-local-mode-lighter ""
"Lighter for Magit-Wip-After-Save-Local mode."
:package-version '(magit . "2.1.0")
:group 'magit-wip-legacy
:type 'string)
(defcustom magit-wip-after-apply-mode-lighter ""
"Lighter for Magit-Wip-After-Apply mode."
:package-version '(magit . "2.1.0")
:group 'magit-wip-legacy
:type 'string)
(defcustom magit-wip-before-change-mode-lighter ""
"Lighter for Magit-Wip-Before-Change mode."
:package-version '(magit . "2.1.0")
:group 'magit-wip-legacy
:type 'string)
(defcustom magit-wip-initial-backup-mode-lighter ""
"Lighter for Magit-Wip-Initial Backup mode."
:package-version '(magit . "2.1.0")
:group 'magit-wip-legacy
:type 'string)
(defcustom magit-wip-merge-branch nil
"Whether to merge the current branch into its wip ref.
@@ -138,7 +109,6 @@ the current branch.
This mode should be enabled globally by turning on the globalized
variant `magit-wip-after-save-mode'."
:package-version '(magit . "2.1.0")
:lighter magit-wip-after-save-local-mode-lighter
(if magit-wip-after-save-local-mode
(if (and buffer-file-name (magit-inside-worktree-p t))
(add-hook 'after-save-hook #'magit-wip-commit-buffer-file t t)
@@ -205,7 +175,6 @@ in the worktree and the other contains snapshots of the entries
in the index."
:package-version '(magit . "2.1.0")
:group 'magit-wip
:lighter magit-wip-after-apply-mode-lighter
:global t)
(defun magit-wip-commit-after-apply (&optional files msg)
@@ -227,7 +196,6 @@ Only changes to files which could potentially be affected by the
command which is about to be called are committed."
:package-version '(magit . "2.1.0")
:group 'magit-wip
:lighter magit-wip-before-change-mode-lighter
:global t)
(defun magit-wip-commit-before-change (&optional files msg)
@@ -239,7 +207,6 @@ command which is about to be called are committed."
"Before saving a buffer for the first time, commit to a wip ref."
:package-version '(magit . "2.90.0")
:group 'magit-wip
:lighter magit-wip-initial-backup-mode-lighter
:global t
(if magit-wip-initial-backup-mode
(add-hook 'before-save-hook #'magit-wip-commit-initial-backup)
+4 -4
View File
@@ -17,14 +17,14 @@
;; Homepage: https://github.com/magit/magit
;; Keywords: git tools vc
;; Package-Version: 4.3.0
;; Package-Version: 4.3.1
;; Package-Requires: (
;; (emacs "27.1")
;; (compat "30.0.2.0")
;; (llama "0.6.0")
;; (magit-section "4.3.0")
;; (llama "0.6.1")
;; (magit-section "4.3.1")
;; (seq "2.24")
;; (transient "0.8.4")
;; (transient "0.8.5")
;; (with-editor "3.4.3"))
;; SPDX-License-Identifier: GPL-3.0-or-later
+433 -433
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,6 +1,6 @@
(define-package "markdown-mode" "20250226.231" "Major mode for Markdown-formatted text"
(define-package "markdown-mode" "20250310.417" "Major mode for Markdown-formatted text"
'((emacs "28.1"))
:commit "f945f12d517ea3fd03bf7d8496c1251dbdf71ebe" :authors
:commit "dd2cb2cdcd6594c3663cda20b465f09c773fcc90" :authors
'(("Jason R. Blevins" . "jblevins@xbeta.org"))
:maintainers
'(("Jason R. Blevins" . "jblevins@xbeta.org"))
+71 -22
View File
@@ -53,6 +53,7 @@
(declare-function sh-set-shell "sh-script")
(declare-function mailcap-file-name-to-mime-type "mailcap")
(declare-function dnd-get-local-file-name "dnd")
(declare-function dnd-open-local-file "dnd")
;; for older emacs<29
(declare-function mailcap-mime-type-to-extension "mailcap")
@@ -108,7 +109,7 @@ Any changes to the output buffer made by this hook will be saved.")
:group 'text
:link '(url-link "https://jblevins.org/projects/markdown-mode/"))
(defcustom markdown-command (let ((command (cl-loop for cmd in '("markdown" "pandoc" "markdown_py")
(defcustom markdown-command (let ((command (cl-loop for cmd in '("markdown" "pandoc" "markdown_py" "cmark" "cmark-gfm")
when (executable-find cmd)
return (file-name-nondirectory it))))
(or command "markdown"))
@@ -705,6 +706,20 @@ This may also be a cons cell where the behavior for `C-a' and
(const :tag "on: before closing tags first" t)
(const :tag "reversed: after closing tags first" reversed))))
:package-version '(markdown-mode . "2.7"))
(defcustom markdown-yank-dnd-method 'file-link
"Action to perform on the dropped files.
When the value is the symbol,
- `copy-and-insert' -- copy file in current directory and insert its link
- `open' -- open dropped file in Emacs
- `insert-link' -- insert link of dropped/pasted file
- `ask' -- ask what to do out of the above."
:group 'markdown
:package-version '(markdown-mode "2.8")
:type '(choice (const :tag "Copy and insert" copy-and-insert)
(const :tag "Open file" open)
(const :tag "Insert file link" file-link)
(const :tag "Ask what to do" ask)))
;;; Markdown-Specific `rx' Macro ==============================================
@@ -9898,12 +9913,8 @@ indicate that sorting should be done in reverse order."
(t 1))))
(sorting-type
(or sorting-type
(progn
;; workaround #641
;; Emacs < 28 hides prompt message by another message. This erases it.
(message "")
(read-char-exclusive
"Sort type: [a]lpha [n]umeric (A/N means reversed): ")))))
(read-char-exclusive
"Sort type: [a]lpha [n]umeric (A/N means reversed): "))))
(save-restriction
;; Narrow buffer to appropriate sorting area
(if (region-active-p)
@@ -10119,18 +10130,50 @@ rows and columns and the column alignment."
(insert " "))
(setq files (cdr files))))))
(defun markdown--dnd-local-file-handler (url _action)
(defun markdown--dnd-read-method ()
(let ((choice (read-multiple-choice "What to do with file?"
'((?c "copy and insert")
(?o "open")
(?i "insert link")))))
(cl-case (car choice)
(?c 'copy-and-insert)
(?o 'open)
(?i 'insert)
(otherwise (markdown--dnd-read-method)))))
(defun markdown--dnd-insert-path (filename)
(let ((mimetype (mailcap-file-name-to-mime-type filename))
(link-text "link text"))
(when (string-match-p "\\s-" filename)
(setq filename (concat "<" filename ">")))
(if (string-prefix-p "image/" mimetype)
(markdown-insert-inline-image link-text filename)
(markdown-insert-inline-link link-text filename))))
(defun markdown--dnd-local-file-handler (url action)
(require 'mailcap)
(require 'dnd)
(let* ((filename (dnd-get-local-file-name url))
(mimetype (mailcap-file-name-to-mime-type filename))
(file (file-relative-name filename))
(link-text "link text"))
(when (string-match-p "\\s-" file)
(setq file (concat "<" file ">")))
(if (string-prefix-p "image/" mimetype)
(markdown-insert-inline-image link-text file)
(markdown-insert-inline-link link-text file))))
(method (if (eq markdown-yank-dnd-method 'ask)
(markdown--dnd-read-method)
markdown-yank-dnd-method)))
(cl-case method
(copy-and-insert
(let ((copied (expand-file-name (file-name-nondirectory filename))))
(copy-file filename copied)
(markdown--dnd-insert-path (file-relative-name copied))))
(open
(dnd-open-local-file url action))
(insert (markdown--dnd-insert-path (file-relative-name filename))))))
(defun markdown--dnd-multi-local-file-handler (urls action)
(let ((multile-urls-p (> (length urls) 1)))
(dolist (url urls)
(markdown--dnd-local-file-handler url action)
(when multile-urls-p
(insert " ")))))
(put 'markdown--dnd-multi-local-file-handler 'dnd-multiple-handler t)
;;; Mode Definition ==========================================================
@@ -10188,10 +10231,10 @@ rows and columns and the column alignment."
;; Add a buffer-local hook to reload after file-local variables are read
(add-hook 'hack-local-variables-hook #'markdown-handle-local-variables nil t)
;; For imenu support
(setq imenu-create-index-function
(if markdown-nested-imenu-heading-index
#'markdown-imenu-create-nested-index
#'markdown-imenu-create-flat-index))
(setq-local imenu-create-index-function (if markdown-nested-imenu-heading-index
#'markdown-imenu-create-nested-index
#'markdown-imenu-create-flat-index)
imenu-submenus-on-top nil)
;; Defun movement
(setq-local beginning-of-defun-function #'markdown-beginning-of-defun)
@@ -10261,8 +10304,14 @@ rows and columns and the column alignment."
#'markdown--inhibit-electric-quote nil :local)
;; drag and drop handler
(setq-local dnd-protocol-alist (cons '("^file:///" . markdown--dnd-local-file-handler)
dnd-protocol-alist))
(let ((dnd-handler (if (>= emacs-major-version 30)
#'markdown--dnd-multi-local-file-handler
#'markdown--dnd-local-file-handler)))
(setq-local dnd-protocol-alist (append
(list (cons "^file:///" dnd-handler)
(cons "^file:/[^/]" dnd-handler)
(cons "^file:[^/]" dnd-handler))
dnd-protocol-alist)))
;; media handler
(when (version< "29" emacs-version)
+9 -9
View File
@@ -1,17 +1,17 @@
(define-package "ol-notmuch" "20230511.2048" "Links to notmuch messages"
'((emacs "25.1")
(compat "29.1.4.1")
(notmuch "0.37")
(org "9.6.5"))
:commit "781c3518a537da2a8b5e8a4424f9441df463a147" :authors
(define-package "ol-notmuch" "20250117.1242" "Links to notmuch messages"
'((emacs "29.1")
(compat "30.0.2.0")
(notmuch "0.38.2")
(org "9.7.19"))
:commit "9a69506a3f9ed31e2f1f967dfaa600702089be45" :authors
'(("Matthieu Lemerre" . "racin@free.fr"))
:maintainers
'(("Jonas Bernoulli" . "jonas@bernoul.li"))
'(("Jonas Bernoulli" . "emacs.ol-notmuch@jonas.bernoulli.dev"))
:maintainer
'("Jonas Bernoulli" . "jonas@bernoul.li")
'("Jonas Bernoulli" . "emacs.ol-notmuch@jonas.bernoulli.dev")
:keywords
'("hypermedia" "mail")
:url "https://git.sr.ht/~tarsius/ol-notmuch")
:url "https://github.com/tarsius/ol-notmuch")
;; Local Variables:
;; no-byte-compile: t
;; End:
+11 -10
View File
@@ -2,18 +2,19 @@
;; Copyright (C) 2010-2011 Matthieu Lemerre
;; Copyright (C) 2010-2021 The Org Contributors
;; Copyright (C) 2021-2023 Jonas Bernoulli
;; Copyright (C) 2021-2025 Jonas Bernoulli
;; Author: Matthieu Lemerre <racin@free.fr>
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
;; Homepage: https://git.sr.ht/~tarsius/ol-notmuch
;; Maintainer: Jonas Bernoulli <emacs.ol-notmuch@jonas.bernoulli.dev>
;; Homepage: https://github.com/tarsius/ol-notmuch
;; Keywords: hypermedia mail
;; Package-Version: 2.1.0
;; Package-Requires: (
;; (emacs "25.1")
;; (compat "29.1.4.1")
;; (notmuch "0.37")
;; (org "9.6.5"))
;; (emacs "29.1")
;; (compat "30.0.2.0")
;; (notmuch "0.38.2")
;; (org "9.7.19"))
;; SPDX-License-Identifier: GPL-3.0-or-later
@@ -37,12 +38,12 @@
;; to folders in other mail clients. Similarly, mails are referred to
;; by a query, so both a link can refer to several mails.
;; Links have one the following forms
;; Links have one of the following forms:
;; - notmuch:<search terms>
;; - notmuch-search:<search terms>.
;; The first form open the queries in `notmuch-show-mode', whereas the
;; second link open it in `notmuch-search-mode'. Note that queries are
;; The first form opens the queries in `notmuch-show-mode', whereas the
;; second link opens it in `notmuch-search-mode'. Note that queries are
;; performed at the time the link is opened, and the result may be
;; different from when the link was stored.
+3 -3
View File
@@ -1,7 +1,7 @@
(define-package "org-appear" "20220617.2355" "Auto-toggle Org elements"
'((emacs "25.1")
(define-package "org-appear" "20240716.1413" "Auto-toggle Org elements"
'((emacs "29.1")
(org "9.3"))
:commit "60ba267c5da336e75e603f8c7ab3f44e6f4e4dac" :authors
:commit "32ee50f8fdfa449bbc235617549c1bccb503cb09" :authors
'(("Alice Istleyeva" . "awth13@gmail.com"))
:maintainers
'(("Alice Istleyeva" . "awth13@gmail.com"))
+8 -6
View File
@@ -4,10 +4,10 @@
;; org-fragtog Copyright (C) 2020 Benjamin Levy - MIT/X11 License
;; org-appear Copyright (C) 2021 Alice Istleyeva - MIT License
;; Author: Alice Istleyeva <awth13@gmail.com>
;; Version: 0.3.0
;; Version: 0.3.1
;; Description: Toggle Org mode element visibility upon entering and leaving
;; Homepage: https://github.com/awth13/org-appear
;; Package-Requires: ((emacs "25.1") (org "9.3"))
;; Package-Requires: ((emacs "29.1") (org "9.3"))
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the "Software"), to deal
@@ -272,8 +272,8 @@ Return nil if element is not supported by `org-appear-mode'."
(link-ignore-p (and (eq elem-type 'link)
(or (string-match-p "[Cc]ite"
(org-element-property :type elem))
(eq 'plain
(org-element-property :format elem)))))
(memq (org-element-property :format elem)
'(plain angle)))))
(key-ignore-p (and (eq elem-type 'keyword)
(not (memq (intern (downcase
(org-element-property :key elem)))
@@ -358,7 +358,8 @@ Return nil if element cannot be parsed."
((eq elem-type 'keyword)
(remove-text-properties start end '(invisible org-link)))
((and (featurep 'org-fold)
(eq elem-type 'link))
(eq elem-type 'link)
(eq org-fold-core-style 'text-properties))
(remove-text-properties start
visible-start
(list (org-fold-core--property-symbol-get-create 'org-link) nil))
@@ -405,7 +406,8 @@ When RENEW is non-nil, obtain element at point instead."
((memq elem-type '(keyword latex-fragment latex-environment))
(font-lock-flush start end))
((and (featurep 'org-fold)
(eq elem-type 'link))
(eq elem-type 'link)
(eq org-fold-core-style 'text-properties))
(put-text-property start
visible-start
(org-fold-core--property-symbol-get-create 'org-link)
+12 -4
View File
@@ -1,9 +1,16 @@
;;; contrib.el --- Code contributed by users
;;; contrib.el --- Code contributed by users -*- lexical-binding: t; -*-
;;; Commentary:
;;
;;; Code:
(defvar org-ref-cite-types)
(declare-function org-element-context "org-element")
(declare-function org-element-type "org-element")
(declare-function org-element-property "org-element")
(declare-function bibtex-completion-apa-format-reference "bibtex-completion")
(declare-function org-ref-parse-cite-path "org-ref-citation-links")
;; * Add messages in minibuffer
;; Contributed in https://github.com/jkitchin/org-ref/issues/938 by @DiogoFerrari
@@ -17,7 +24,7 @@ If not on a key, but on a cite, prompt for key."
key
;; point is not on a key, but may still be on a cite link
(let ((el (org-element-context))
data
data text
keys)
(cond
;; on a cite-link type
@@ -33,7 +40,7 @@ If not on a key, but on a cite, prompt for key."
(dolist (key keys)
(search-forward key)
(goto-char (match-beginning 0))
(get-text-property (point) 'cite-key)
;; (get-text-property (point) 'cite-key)
;; (message (bibtex-completion-apa-format-reference key))
(setq text (concat text "\n" (bibtex-completion-apa-format-reference key))))))))
(message (string-trim-left text)))
@@ -45,7 +52,8 @@ If not on a key, but on a cite, prompt for key."
(defcustom org-ref-message-interval 0.5
"Time in seconds to wait for the idle timer that displays the cite message."
:group 'org-ref)
:group 'org-ref
:type 'float)
(defun org-ref-link-message ()
+13 -3
View File
@@ -43,6 +43,10 @@
(declare-function org-bibtex-yank "org-bibtex")
(declare-function org-ref-possible-bibfiles "org-ref-core")
(declare-function f-ext? "f")
(declare-function f-entries "f")
(declare-function s-match "s")
(eval-when-compile
(require 'cl-lib))
(require 'bibtex)
@@ -1006,7 +1010,9 @@ Opening %s" json-data url))
(url (plist-get results :URL))
(booktitle (plist-get results :container-title))
(school (or (plist-get results :school)
(plist-get (plist-get results :institution) :name)))))
(plist-get (plist-get results :institution) :name)))
;; I am not sure how general this is. This gets the first name.
(institution (plist-get (car (plist-get results :institution)) :name))))
;; Next, we need to define the different bibtex types. Each type has a bibtex
;; type (for output) and the type as provided in the doi record. Finally, we
@@ -1066,13 +1072,17 @@ MATCHING-TYPES."
(doi-utils-def-bibtex-type inproceedings ("proceedings-article" "paper-conference")
author title booktitle year month pages doi url)
(doi-utils-def-bibtex-type book ("book")
(doi-utils-def-bibtex-type book ("book" "edited-book")
author title series publisher year pages doi url)
(doi-utils-def-bibtex-type inbook ("chapter" "book-chapter" "reference-entry")
author title booktitle series publisher year pages doi url)
(doi-utils-def-bibtex-type phdthesis ("phdthesis" "thesis" "dissertation")
author title school publisher year)
author title school publisher year)
(doi-utils-def-bibtex-type techreport ("report")
institution author title publisher year doi url)
;; this is what preprints in chemrxiv look like for now
(doi-utils-def-bibtex-type misc ("posted-content")
+1 -1
View File
@@ -1,4 +1,4 @@
;;; nist-webbook.el --- Integration of Emacs with NIST Webbook
;;; nist-webbook.el --- Integration of Emacs with NIST Webbook -*- lexical-binding: t; -*-
;; Integration of Emacs with NIST webbook
;;; Commentary:
+829 -109
View File
File diff suppressed because it is too large Load Diff
+11 -14
View File
@@ -1,6 +1,6 @@
;;; org-ref-arxiv.el --- arxiv utilities for org-mode -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
@@ -137,9 +137,9 @@ Returns a formatted BibTeX entry."
(org-ref-replace-nonascii)
(bibtex-generate-autokey)))
(doi (assq 'doi entry)))
(if doi
(doi-utils-doi-to-bibtex-string (nth 2 doi))
;; no doi, so we fall back to the simple template
(unless (and doi
(ignore-errors (doi-utils-doi-to-bibtex-string (nth 2 doi))))
;; no doi or inactive doi, so we fall back to the simple template
(format arxiv-entry-format-string key title names year arxiv-number category abstract url)))))
@@ -223,15 +223,7 @@ Returns a formatted BibTeX entry."
(arxiv-maybe-arxiv-id-from-current-kill))
(read-string
"PDF: ")))
(let ((pdf-url (with-current-buffer
(url-retrieve-synchronously
(concat
"http://arxiv.org/abs/" arxiv-number))
;; <meta name="citation_pdf_url" content="http://arxiv.org/pdf/0801.1144" />
(goto-char (point-min))
(search-forward-regexp
"name=\\\"citation_pdf_url\\\" content=\\\"\\(.*\\)\\\"")
(match-string 1))))
(let ((pdf-url (format "https://arxiv.org/pdf/%s" arxiv-number)))
(url-copy-file pdf-url pdf)
;; now check if we got a pdf
(unless (org-ref-pdf-p pdf)
@@ -296,8 +288,13 @@ key."
(when (file-exists-p (concat pdfdir key ".pdf"))
(bibtex-end-of-entry)
(backward-char)
(insert (format " file = {%s}\n " (concat pdfdir key ".pdf")))))))
(insert (format " file = {%s}\n " (concat pdfdir key ".pdf")))))
(save-buffer)))
(provide 'org-ref-arxiv)
;;; org-ref-arxiv.el ends here
;; Local Variables:
;; byte-compile-warnings: (not docstrings)
;; End:
+6 -2
View File
@@ -1,6 +1,6 @@
;;; org-ref-bibliography-links.el --- Bibliography and bibliographystyle links
;;; org-ref-bibliography-links.el --- Bibliography and bibliographystyle links -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
@@ -310,3 +310,7 @@ Optional argument BACKEND is the export backend."
(provide 'org-ref-bibliography-links)
;;; org-ref-bibliography-links.el ends here
;; Local Variables:
;; byte-compile-warnings: (not docstrings)
;; End:
+10 -4
View File
@@ -1,6 +1,6 @@
;;; org-ref-bibtex.el -- org-ref-bibtex utilities
;;; org-ref-bibtex.el -- org-ref-bibtex utilities -*- lexical-binding: t; -*-
;; Copyright(C) 2014-2021 John Kitchin
;; Copyright(C) 2014-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; URL: https://github.com/jkitchin/org-ref
@@ -67,8 +67,10 @@
(require 's)
(require 'doi-utils)
(require 'avy)
(require 'sgml-mode)
(defvar bibtex-completion-bibliography)
(defvar bibtex-completion-library-path)
(declare-function bibtex-completion-show-entry "bibtex-completion")
(declare-function org-ref-find-bibliography "org-ref-core")
(declare-function org-element-property "org-element")
@@ -1171,7 +1173,7 @@ will clobber the file."
(format "%s = %s,\n" f v))))
(-uniq other-fields) "\n")
"\n}"))
(bibtex-find-entry key)
(bibtex-search-entry key)
(bibtex-fill-entry)
(bibtex-clean-entry))))
@@ -1201,7 +1203,7 @@ will clobber the file."
(cdr (assoc field entry))))
entry-fields "\n")
"\n}\n\n"))
(bibtex-find-entry key)
(bibtex-search-entry key)
(bibtex-fill-entry)
(bibtex-clean-entry)))
@@ -1460,3 +1462,7 @@ See functions in `org-ref-clean-bibtex-entry-hook'."
(provide 'org-ref-bibtex)
;;; org-ref-bibtex.el ends here
;; Local Variables:
;; byte-compile-warnings: (not docstrings-wide)
;; End:
+28 -24
View File
@@ -1,6 +1,6 @@
;;; org-ref-citation-links.el --- citation links for org-ref -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
@@ -47,11 +47,15 @@
;; natmove like preprocessing is provided with `org-ref-cite-natmove'.
;;
;;; Code:
(require 'org-keys)
(require 'hydra)
(require 'xref)
(eval-when-compile (require 'subr-x))
(defvar bibtex-completion-cache)
(declare-function bibtex-completion-format-citation-cite "bibtex-completion")
(declare-function bibtex-completion-show-entry "bibtex-completion")
(defgroup org-ref-faces nil
"A group for faces in `org-ref'."
:group 'org-ref-faces)
@@ -592,13 +596,13 @@ PATH has the citations in it."
"Get a tooltip for the cite at POSITION."
(let ((key (get-text-property position 'cite-key)))
(when key
(let ((bibtex-completion-bibliography (org-ref-find-bibliography))
(has-pdf (when (bibtex-completion-find-pdf key) bibtex-completion-pdf-symbol))
(has-notes (when (cl-some #'identity
(mapcar (lambda (fn)
(funcall fn key))
bibtex-completion-find-note-functions))
bibtex-completion-notes-symbol)))
(let* ((bibtex-completion-bibliography (org-ref-find-bibliography))
(has-pdf (when (bibtex-completion-find-pdf key) bibtex-completion-pdf-symbol))
(has-notes (when (cl-some #'identity
(mapcar (lambda (fn)
(funcall fn key))
bibtex-completion-find-note-functions))
bibtex-completion-notes-symbol)))
(format "%s%s %s" (or has-pdf "") (or has-notes "")
(bibtex-completion-apa-format-reference key))))))
@@ -1048,21 +1052,17 @@ If not on a key, but on a cite, prompt for key."
(t
(let ((el (org-element-context))
(cp (point))
(org-ref-activate-cite-links t) ;; temporary
data
keys
)
(and
(eq (org-element-type el) 'link)
(assoc (org-element-property :type el) org-ref-cite-types))
(save-excursion
;; We activate just this one link
(org-ref-cite-activate
(org-element-property :begin el)
(org-element-property :end el)
(org-element-property :path el)
nil))
(org-ref-activate-cite-links t)) ;; temporary
(when (and
(eq (org-element-type el) 'link)
(assoc (org-element-property :type el) org-ref-cite-types))
(save-excursion
;; We activate just this one link
(org-ref-cite-activate
(org-element-property :begin el)
(org-element-property :end el)
(org-element-property :path el)
nil)))
;; Now we have to handle some cases.
(cond
;; on a key, return a key
@@ -1423,3 +1423,7 @@ Here is an example use:
(provide 'org-ref-citation-links)
;;; org-ref-citation-links.el ends here
;; Local Variables:
;; byte-compile-warnings: (not docstrings docstrings-wide)
;; End:
+4 -4
View File
@@ -1,4 +1,4 @@
;;; org-ref-compat.el --- Compatibility functions for org-cite
;;; org-ref-compat.el --- Compatibility functions for org-cite -*- lexical-binding: t; -*-
;;; Commentary:
;;
@@ -35,14 +35,14 @@ There is no way to get them all though, there are conflicting
translations with some biblatex and some natbib commands. This
list maps the natbib commands. I have also opted to use the full
names rather than the short names."
:group 'org-ref)
:group 'org-ref
:type '(list (cons string string)))
(defun org-ref-to-org-cite ()
(interactive)
(let ((ref-cites (reverse (org-ref-get-cite-links)))
ref-type
path
type path
beg end)
;; This takes care of the cite links
(cl-loop for rc in ref-cites do
+6 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-core.el --- citations, cross-references and bibliographies in org-mode -*- lexical-binding: t; -*-
;; Copyright(C) 2014-2021 John Kitchin
;; Copyright(C) 2014-2024 John Kitchin
;; This file is not currently part of GNU Emacs.
@@ -53,6 +53,7 @@
(require 'org-ref-utils)
(require 'org-ref-bibtex)
(require 'org-ref-glossary)
(require 'openalex)
;;* Custom variables
@@ -337,3 +338,7 @@ provide their own version."
(provide 'org-ref-core)
;;; org-ref-core.el ends here
;; Local Variables:
;; byte-compile-warnings: (not docstrings docstrings-wide)
;; End:
+33 -29
View File
@@ -1,6 +1,6 @@
;;; org-ref-export.el --- org-ref-export library -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
@@ -52,6 +52,8 @@
(require 'citeproc)
(defvar org-cite-csl-styles-dir)
(defcustom org-ref-backend-csl-formats
'((html . html)
(latex . latex)
@@ -66,11 +68,14 @@
(defcustom org-ref-cite-internal-links 'auto
"Should be one of
- 'bib-links :: link cites to bibliography entries
- 'no-links :: do not link cites to bibliography entries
- nil or 'auto :: add links based on the style."
:type '(choice bib-links no-links auto nil)
"Should be one of these symbols (quoted)
- bib-links :: link cites to bibliography entries
- no-links :: do not link cites to bibliography entries
- nil or auto :: add links based on the style."
:type '(choice symbol (sexp :tag bib-links)
symbol (sexp :tag no-links)
symbol (sexp :tag auto-links)
symbol (sexp :tag nil))
:group 'org-ref)
@@ -212,17 +217,16 @@ REF is a plist data structure returned from `org-ref-parse-cite-path'."
(suffix . ,suffix)
(locator . ,locator)
(label . ,(when label (org-ref-dealias-label (string-trim label))))
;; TODO: proof of concept and not complete. I did not go through all the
;; types to see what else should be in here.
(suppress-author . ,(not (null (member type
'("citenum"
"citeyear"
"citeyear*"
"citedate"
"citedate*"
"citetitle"
"citetitle*"
"citeurl"))))))))
;; [2024-01-29 Mon] see
;; https://github.com/jkitchin/org-ref/issues/1103#issuecomment-1915028374
;; and related comments at
;; https://github.com/andras-simonyi/citeproc-el/issues/151. It seems I
;; should not be adding this. TODO: proof of concept and not complete. I
;; did not go through all the types to see what else should be in here.
;; (suppress-author . ,(not (null (member type '("citenum" "citeyear"
;; "citeyear*" "citedate" "citedate*" "citetitle" "citetitle*"
;; "citeurl")))))
)))
(declare-function org-ref-find-bibliography "org-ref-core")
@@ -513,9 +517,9 @@ VISIBLE-ONLY BODY-ONLY and INFO."
"Export the buffer to PDF via LaTeX and open.
See `org-export-as' for the meaning of ASYNC SUBTREEP
VISIBLE-ONLY BODY-ONLY and INFO."
(let ((org-export-before-parsing-hook (append
org-export-before-parsing-hook
'(org-ref-csl-preprocess-buffer))))
(let ((org-export-before-parsing-functions (append
org-export-before-parsing-functions
'(org-ref-csl-preprocess-buffer))))
(org-open-file (org-latex-export-to-pdf async subtreep visible-only
body-only info))))
@@ -595,8 +599,8 @@ VISIBLE-ONLY BODY-ONLY and INFO."
(?e "to email" org-ref-export-to-message)
(?w "to docx" org-ref-export-to-docx))))
;; An alternative to this exporter is to use an `org-export-before-parsing-hook'
;; (add-hook 'org-export-before-parsing-hook 'org-ref-csl-preprocess-buffer)
;; An alternative to this exporter is to use an `org-export-before-parsing-functions'
;; (add-hook 'org-export-before-parsing-functions 'org-ref-csl-preprocess-buffer)
(defun org-ref-csl-preprocess-buffer (backend)
"Preprocess the buffer in BACKEND export.
@@ -627,27 +631,27 @@ I am not positive on this though."
(when (and org-ref/citeproc org-ref/bblproc)
(error "You cannot use CSL and BBL at the same time."))
(let ((org-export-before-parsing-hook org-export-before-parsing-hook))
(let ((org-export-before-parsing-functions org-export-before-parsing-functions))
(when org-ref/citeproc
(cl-pushnew 'org-ref-csl-preprocess-buffer org-export-before-parsing-hook))
(cl-pushnew 'org-ref-csl-preprocess-buffer org-export-before-parsing-functions))
(when org-ref/refproc
(cl-pushnew 'org-ref-refproc org-export-before-parsing-hook))
(cl-pushnew 'org-ref-refproc org-export-before-parsing-functions))
(when org-ref/acrossproc
(cl-pushnew 'org-ref-acrossproc org-export-before-parsing-hook))
(cl-pushnew 'org-ref-acrossproc org-export-before-parsing-functions))
(when org-ref/idxproc
(cl-pushnew 'org-ref-idxproc org-export-before-parsing-hook))
(cl-pushnew 'org-ref-idxproc org-export-before-parsing-functions))
(when org-ref/bblproc
(unless (featurep 'org-ref-natbib-bbl-citeproc)
(require 'org-ref-natbib-bbl-citeproc))
(cl-pushnew 'org-ref-bbl-preprocess org-export-before-parsing-hook))
(cl-pushnew 'org-ref-bbl-preprocess org-export-before-parsing-functions))
;; this goes last since it moves cites before they might get replaced.
(when org-ref/natmove
(cl-pushnew 'org-ref-cite-natmove org-export-before-parsing-hook))
(cl-pushnew 'org-ref-cite-natmove org-export-before-parsing-functions))
(org-export-dispatch arg)))
+98 -140
View File
@@ -1,6 +1,6 @@
;;; org-ref-glossary.el --- glossary support in org-ref -*- lexical-binding: t; -*-
;; Copyright (C) 2016-2021 John Kitchin
;; Copyright (C) 2016-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
@@ -45,7 +45,7 @@
;; #+name: acronyms
;; | key | abbreviation | full form |
;; |------+--------------+--------------------------------|
;; | mimo | | multiple-input multiple output |
;; | mimo | mimo | multiple-input multiple output |
;; | qos | QoS | quality-of-service |
;; | bb | BB | branch and bound |
;;
@@ -102,7 +102,7 @@ This is not always fast, so we provide a way to disable it."
:group 'org-ref-glossary)
(defvar org-ref-glsentries '()
(defcustom org-ref-glsentries '()
"Variable to hold locations of glsentries load files.")
@@ -152,7 +152,7 @@ changes."
;; We don't have a cache, or an entry in it, so we find it.
;; No cache? we make one
(unless org-ref-glossary-cache
(setq-local org-ref-glossary-cache (make-hash-table)))
(setq-local org-ref-glossary-cache (make-hash-table :test 'equal)))
;; Now we search to get the data
(save-excursion
@@ -171,13 +171,14 @@ changes."
external))))
org-ref-glsentries)
(cdr (assoc external org-ref-glsentries))))))
key value p1 p2)
key value p1 p2 position)
(setq data
(catch 'data
;; look inside first for latex-headers
(goto-char (point-min))
(when (re-search-forward
(format "\\newglossaryentry{%s}" entry) nil t)
(setq position (match-beginning 0))
(re-search-forward "{")
(save-excursion
(backward-char)
@@ -206,7 +207,8 @@ changes."
(setq data (append data
(list :label entry)
(list (intern (format ":%s" key)))
(list value))))
(list value)
(list :position position))))
(throw 'data data))
;; check for a glossary table
@@ -218,11 +220,15 @@ changes."
(lambda (el)
(when (string= "glossary" (org-element-property :name el))
(goto-char (org-element-property :contents-begin el))
(setq position (point))
(throw 'found
(nthcdr 2 (org-babel-read-table)))))))))
(result (assoc entry entries)))
(when result
(throw 'data (list :label entry :name (cl-second result) :description (cl-third result)))))
(throw 'data (list :label entry
:name (cl-second result)
:description (cl-third result)
:position position))))
;; then external
(when (and glsentries
@@ -231,7 +237,7 @@ changes."
(with-current-buffer (find-file-noselect glsentries)
(goto-char (point-min))
(when (re-search-forward
(format "\\newglossaryentry{%s}" entry) nil t)
(format "\\newglossaryentry{%s}" entry) nil t)
(re-search-forward "{")
(save-excursion
(backward-char)
@@ -255,65 +261,57 @@ changes."
(setq data (append data
(list :label entry)
(list (intern (format ":%s" key)))
(list value))))
(list value)
(list :position nil))))
(throw 'data data))))))
(puthash entry data org-ref-glossary-cache)
data))))
;;;###autoload
(defun org-ref-add-glossary-entry (label name description)
"Insert a new glossary entry.
LABEL is how you refer to it with links.
NAME is the name of the entry to be defined.
DESCRIPTION is the definition of the entry.
Entry gets added after the last #+latex_header line.
This is not a preferred way to add entries. It is preferred to
manually add them to the glossary table."
(interactive "sLabel: \nsName: \nsDescription: ")
(save-excursion
(goto-char (point-max))
;; get to the last latex_header line
(re-search-backward "#\\+latex_header" nil t)
(forward-line)
(when (not (looking-at "^$"))
(beginning-of-line)
(insert "\n")
(forward-line -1))
(insert (format "#+latex_header_extra: \\newglossaryentry{%s}{name={%s},description={%s}}\n"
label name description))))
(defun org-ref-glossary-face-fn (label)
"Return a face for a glossary link."
(if org-ref-activate-glossary-links
(save-match-data
(cond
((or-parse-glossary-entry label)
'org-ref-glossary-face)
(t
'font-lock-warning-face)))
'org-ref-glossary-face))
;;** Glossary links
(defun or-activate-glossary (start end path bracketp)
"Activate function for a glossary link.
set data on text with properties
Set face property, and help-echo."
(let ((data (or (or-parse-glossary-entry path)
(or-parse-acronym-entry path))))
(add-text-properties
start end
(list 'or-glossary data
'face (if data
'org-ref-glossary-face
'font-lock-warning-face)))))
(defface org-ref-glossary-face
`((t (:inherit org-link :foreground "Mediumpurple3")))
"Face for glossary links.")
(defun or-follow-glossary (entry)
"Goto beginning of the glossary ENTRY."
(org-mark-ring-push)
(cond
;; Try finding in the table
((progn (goto-char (point-min))
(and (re-search-forward "#\\+name: glossary" nil t)
(re-search-forward entry nil t)))
nil)
(goto-char (plist-get (get-text-property (point) 'or-glossary) :position)))
((progn (goto-char (point-min)) (re-search-forward (format "\\newglossaryentry{%s}" entry) nil t))
(goto-char (match-beginning 0)))
(t
(message "no entry found for %s" entry))))
(defun or-glossary-tooltip (_window buffer position)
"Return tooltip for the glossary entry.
The entry is in WINDOW and OBJECT at POSITION.
Used in fontification."
(with-current-buffer buffer
(let* ((data (get-text-property position 'or-glossary))
(name (or (plist-get data :name)
(plist-get data :abbrv)))
(description (or (plist-get data :description)
(plist-get data :full))))
(format
"%s: %s"
name
(with-temp-buffer
(insert (concat description "."))
(fill-paragraph)
(buffer-string))))))
(defvar org-ref-glossary-gls-commands
@@ -330,7 +328,7 @@ manually add them to the glossary table."
(dolist (command org-ref-glossary-gls-commands)
(org-link-set-parameters (cl-first command)
:follow #'or-follow-glossary
:face 'org-ref-glossary-face-fn
:activate-func #'or-activate-glossary
:help-echo 'or-glossary-tooltip
:export (lambda (path _ format)
(cond
@@ -342,6 +340,7 @@ manually add them to the glossary table."
(org-link-set-parameters "glslink"
:follow #'or-follow-glossary
:activate-func #'or-activate-glossary
:face 'org-ref-glossary-face-fn
:help-echo 'or-glossary-tooltip
:export (lambda (path desc format)
@@ -351,33 +350,8 @@ manually add them to the glossary table."
(t
(format "%s" path)))))
;;** Tooltips on glossary entries
(defface org-ref-glossary-face
`((t (:inherit org-link :foreground "Mediumpurple3")))
"Face for glossary links.")
(defun or-glossary-tooltip (_window _object position)
"Return tooltip for the glossary entry.
The entry is in WINDOW and OBJECT at POSITION.
Used in fontification."
(save-excursion
(goto-char position)
(let* ((label (org-element-property :path (org-element-context)))
(data (or (or-parse-glossary-entry label)
(or-parse-acronym-entry label)))
(name (or (plist-get data :name)
(plist-get data :abbrv)))
(description (or (plist-get data :description)
(plist-get data :full))))
(format
"%s: %s"
name
(with-temp-buffer
(insert (concat description "."))
(fill-paragraph)
(buffer-string))))))
;; ** printglossaries links
;; There is a printglossary command in LaTeX, but I am not supporting it for now.
@@ -440,26 +414,6 @@ This is intended to be run in `org-export-before-parsing-hook'."
;;* Acronyms
;;;###autoload
(defun org-ref-add-acronym-entry (label abbrv full)
"Add an acronym entry with LABEL.
ABBRV is the abbreviated form.
FULL is the expanded acronym.
This is not the preferred way to add acronyms, you should add
them manually to the acronyms table."
(interactive "sLabel: \nsAcronym: \nsFull name: ")
(save-excursion
(re-search-backward "#\\+latex_header" nil t)
(forward-line)
(when (not (looking-at "^$"))
(beginning-of-line)
(insert "\n")
(forward-line -1))
(insert (format "#+latex_header_extra: \\newacronym{%s}{%s}{%s}\n"
label abbrv full))))
(defun or-parse-acronym-entry (label)
"Parse an acronym entry LABEL to a plist.
Returns (:abbrv abbrv :full full :label label)
@@ -470,7 +424,7 @@ The plist maps to \newacronym{<label>}{<abbrv>}{<full>}"
;; We don't have a cache, or an label in it, so we find it.
;; No cache? we make one
(unless org-ref-acronym-cache
(setq-local org-ref-acronym-cache (make-hash-table)))
(setq-local org-ref-acronym-cache (make-hash-table :test 'equal )))
;; Now search for the data
(save-excursion
@@ -539,10 +493,24 @@ The plist maps to \newacronym{<label>}{<abbrv>}{<full>}"
(defun org-ref-glossary-invalidate-caches ()
"Function to invalidate the caches."
(interactive)
(setq-local org-ref-acronym-cache (make-hash-table))
(setq-local org-ref-glossary-cache (make-hash-table)))
(setq-local org-ref-acronym-cache (make-hash-table :test 'equal))
(setq-local org-ref-glossary-cache (make-hash-table :test 'equal)))
;;** Acronym links
(defun or-activate-acronym (start end path bracketp)
"Activate function for an acronym link.
set data on text with properties
Set face property, and help-echo."
(let ((data (or-parse-acronym-entry path)))
(add-text-properties
start end
(list 'or-glossary data
'face (if data
'org-ref-acronym-face
'font-lock-warning-face)))))
(defun or-follow-acronym (label)
"Go to the definition of the acronym LABEL."
(org-mark-ring-push)
@@ -560,6 +528,30 @@ The plist maps to \newacronym{<label>}{<abbrv>}{<full>}"
(message "no entry found for %s" label))))
;;** Tooltips on acronyms
(defface org-ref-acronym-face
`((t (:inherit org-link :foreground "Darkorange2")))
"Face for acronym links.")
(defun or-acronym-tooltip (_window buffer position)
"Return tooltip for the acronym entry.
The entry is in WINDOW and OBJECT at POSITION.
Used in fontification.
WINDOW and OBJECT are ignored."
(with-current-buffer buffer
(save-excursion
(goto-char position)
(let* ((acronym-data (get-text-property position 'or-glossary))
(abbrv (plist-get acronym-data :abbrv))
(full (plist-get acronym-data :full)))
(if acronym-data
(format
"%s: %s"
abbrv full)
(format "This is not defined in this file."))))))
(defvar org-ref-acronym-types
'(("acrshort" "The acronym for label")
("acrshortpl" "The acronym for label in plural")
@@ -587,8 +579,8 @@ The plist maps to \newacronym{<label>}{<abbrv>}{<full>}"
(cl-dolist (mapping org-ref-acronym-types)
(org-link-set-parameters (cl-first mapping)
:follow #'or-follow-acronym
:face 'org-ref-acronym-face-fn
:help-echo 'or-acronym-tooltip
:activate-func #'or-activate-acronym
:help-echo #'or-acronym-tooltip
:export (lambda (path _ format)
(cond
((memq format '(latex beamer))
@@ -597,40 +589,6 @@ The plist maps to \newacronym{<label>}{<abbrv>}{<full>}"
(format "%s" (upcase path)))))))
;;** Tooltips on acronyms
(defface org-ref-acronym-face
`((t (:inherit org-link :foreground "Darkorange2")))
"Face for acronym links.")
(defun org-ref-acronym-face-fn (label)
"Return a face for an acronym link."
(if org-ref-activate-glossary-links
(save-match-data
(cond
((or-parse-acronym-entry label)
'org-ref-acronym-face)
(t
'font-lock-warning-face)))
'org-ref-acronym-face))
(defun or-acronym-tooltip (_window _object position)
"Return tooltip for the acronym entry.
The entry is in WINDOW and OBJECT at POSITION.
Used in fontification.
WINDOW and OBJECT are ignored."
(save-excursion
(goto-char position)
(let* ((label (org-element-property :path (org-element-context)))
(acronym-data (or-parse-acronym-entry label))
(abbrv (plist-get acronym-data :abbrv))
(full (plist-get acronym-data :full)))
(if acronym-data
(format
"%s: %s"
abbrv full)
(format "%s is not defined in this file." label)))))
;; ** Exporting with an acronym table
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-helm.el --- org-ref interface to helm-bibtex -*- lexical-binding: t; -*-
;; Copyright(C) 2014-2022 John Kitchin
;; Copyright(C) 2014-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; URL: https://github.com/jkitchin/org-ref
+2 -2
View File
@@ -1,6 +1,6 @@
;;; org-ref-isbn.el --- utilities for generating bibtex entries from an ISBN -*- lexical-binding: t; -*-
;; Copyright (C) 2015 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
@@ -25,7 +25,7 @@
;;; Code:
(require 'f)
(require 'org)
(require 'org-ref-core)
(defvar url-http-end-of-headers)
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-ivy.el --- org-ref with ivy completion -*- lexical-binding: t; -*-
;; Copyright (C) 2016-2021 John Kitchin
;; Copyright (C) 2016-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; URL: https://github.com/jkitchin/org-ref
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-label-link.el --- -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
+190 -18
View File
@@ -1,6 +1,6 @@
;;; org-ref-latex.el --- org-ref functionality for LaTeX files -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: languages
@@ -25,10 +25,34 @@
(require 'org-ref-citation-links)
(require 'bibtex-completion)
(require 'tex-mode)
(defvar latex-mode-map)
(defvar org-ref-cite-types)
(defcustom orl-cite-keymap
(let ((map (copy-keymap latex-mode-map)))
(define-key map (kbd "S-<left>") #'orl-cite-shift-left)
(define-key map (kbd "S-<right>") #'orl-cite-shift-right)
(define-key map (kbd "S-<up>") #'orl-sort-cite-keys)
(define-key map (kbd "S-<down>") (lambda () (interactive) (orl-sort-cite-keys t)))
(define-key map (kbd "<tab>") #'org-ref-latex-insert-citation)
(define-key map [mouse-1] (lambda ()
(interactive)
(let ((bibtex-completion-bibliography (org-ref-latex-get-bibliography)))
(bibtex-completion-show-entry (list (org-ref-latex-key-at-point)))
(bibtex-beginning-of-entry))))
map)
"Key map for cite keys."
:group 'org-ref-latex
:type '(restricted-sexp
:match-alternatives
((lambda (x)
(or (keymapp x) ; Can be a keymap var.
(and (symbolp x)
(boundp x)
(keymapp (symbol-value x))))))))
(defvar org-ref-latex-cite-re
(concat "\\\\\\(?1:" (mapconcat
@@ -37,15 +61,15 @@
(mapcar 'car org-ref-cite-types)
"\\|")
"\\)"
"\\(?2:\\[[^]]*\\]\\)?" ; optional []
"\\(?3:\\[[^]]*\\]\\)?" ; optional []
"\\(?2:\\[[^]]*\\]\\)?" ; optional []
"\\(?3:\\[[^]]*\\]\\)?" ; optional []
"{\\(?4:[^}]*\\)}") ; group 4 contains the keys
"Regexp for LaTeX citations. \\citetype[opti{o}nal][optiona{l}]{some,keys}.
The clickable part are the keys.")
(defun org-ref-latex-get-bibliography ()
"Find bibliographies in the tex file"
"Find bibliographies in the tex file."
(save-excursion
(let ((bibliography '()))
(goto-char (point-min))
@@ -65,6 +89,23 @@ The clickable part are the keys.")
"Font-lock function to make cites in LaTeX documents clickable."
(while (re-search-forward org-ref-latex-cite-re limit t)
(setq font-lock-extra-managed-props (delq 'help-echo font-lock-extra-managed-props))
;; save data on cite. This is useful later for modifying cites, clicking, etc.
(add-text-properties (match-beginning 0) (match-end 0)
`(org-ref-latex-cite (
:cite-begin ,(match-beginning 0)
:cite-end ,(match-end 0)
:cite-key-begin ,(+ 1 (match-beginning 4))
:cite-key-end ,(- (match-end 4) 1)
:cite-type ,(match-string-no-properties 1)
:optional-1 ,(match-string-no-properties 2)
:optional-2 ,(match-string-no-properties 3)
:keys ,(mapcar
#'s-trim
(s-split
","
(match-string-no-properties 4))))))
(goto-char (match-beginning 0))
(let ((end (match-end 0)))
(cl-loop for key in (mapcar #'s-trim (split-string (match-string-no-properties 4) ","))
@@ -75,19 +116,14 @@ The clickable part are the keys.")
(add-text-properties
(match-beginning 0)
(match-end 0)
`(mouse-face highlight
local-map ,(let ((map (copy-keymap latex-mode-map)))
(define-key map [mouse-1]
`(lambda ()
(interactive)
(let ((bibtex-completion-bibliography (org-ref-latex-get-bibliography)))
(bibtex-completion-show-entry (list ,key))
(bibtex-beginning-of-entry))))
map)
help-echo ,(let* ((bibtex-completion-bibliography (org-ref-latex-get-bibliography)))
(condition-case nil
(bibtex-completion-apa-format-reference key)
(error (display-warning :warning (format "Key %s missing." key)))))))))
`(
org-ref-cite-key ,key
mouse-face highlight
local-map ,orl-cite-keymap
help-echo ,(let* ((bibtex-completion-bibliography (org-ref-latex-get-bibliography)))
(condition-case nil
(bibtex-completion-apa-format-reference key)
(error (display-warning :warning (format "Key %s missing." key)))))))))
(goto-char end))))
@@ -98,6 +134,142 @@ The clickable part are the keys.")
'((org-ref-next-latex-cite 0 font-lock-constant-face))))
(add-hook 'LaTeX-mode-hook 'org-ref-latex-cite-on)
(add-hook 'LaTeX-mode-hook 'org-ref-latex-cite-on)
;; * Insert cite link
(defun org-ref-latex-on-citation-p ()
"Return non-nil if on a citation."
(get-text-property (point) 'org-ref-latex-cite))
(defun org-ref-latex-key-at-point ()
"Return key at point if there is one."
(interactive)
(get-text-property (point) 'org-ref-cite-key))
(defun orl-insert-key (key)
(cond
;; on a key
((get-text-property (point) 'org-ref-cite-key)
(forward-sexp)
(insert (format ",%s" key)))
;; on the leading \
((and (get-text-property (point) 'org-ref-latex-cite)
(looking-at "\\\\"))
(search-forward "{")
(insert (format "%s," key)))
;; on {
((and (get-text-property (point) 'org-ref-latex-cite)
(looking-at "{"))
(forward-char)
(insert (format "%s," key)))
;; on }
((and (get-text-property (point) 'org-ref-latex-cite)
(looking-at "}"))
(insert (format ",%s" key)))
;; on citetype
((and (get-text-property (point) 'org-ref-latex-cite)
(get-text-property (point) 'org-ref-latex-cite-type))
(search-forward "{")
(insert (format "%s," key)))
;; everything else
(t
(insert (format "\\cite{%s}" key)))))
(defun org-ref-latex-insert-citation ()
"Insert a citation key with completion.
Should DWIM inserting into existing or new citations."
(interactive)
;; This initializes bibtex if the variable is not defined.
(unless bibtex-completion-display-formats-internal
(bibtex-completion-init))
(let* ((bibtex-completion-bibliography (org-ref-latex-get-bibliography))
(candidates (bibtex-completion-candidates)))
(ivy-read "org-ref-ivy BibTeX entries: " candidates
:preselect (ivy-thing-at-point)
:action '(1
("o" (lambda (candidate)
(orl-insert-key (cdr (assoc "=key=" (cdr candidate)))))
"insert")))))
(defun orl-swap-citation (direction)
(let* ((key (org-ref-latex-key-at-point))
(data (get-text-property (point) 'org-ref-latex-cite))
(keys (plist-get data :keys))
(i (seq-position keys key #'string=))
cite-string)
(if (> direction 0)
(org-ref-swap-list-elements i (min (+ i 1) (- (length keys) 1)) keys)
(org-ref-swap-list-elements i (max (- i 1) 0) keys))
(setq data (plist-put data :keys keys))
;; now render it
(setq cite-string (concat (format "\\%s" (plist-get data :cite-type))
(or (plist-get data :optional-1) "")
(or (plist-get data :optional-2) "")
(format "{%s}" (s-join "," (plist-get data :keys)))))
(cl--set-buffer-substring (plist-get data :cite-begin)
(plist-get data :cite-end)
cite-string)
(search-forward key)
(goto-char (match-beginning 0))))
(defun orl-cite-shift-left ()
"Shift cite key at point to the left."
(interactive)
(orl-swap-citation -1))
(defun orl-cite-shift-right ()
"Shift cite-key at point to the right."
(interactive)
(orl-swap-citation +1))
(defun orl-sort-cite-keys (&optional descending)
"Sort keys in ascending order by year.
With prefix arg DESCENDING, sort in descending order."
(interactive "P")
(let* ((data (get-text-property (point) 'org-ref-latex-cite))
(keys (plist-get data :keys))
cite-string)
(setq data (plist-put data :keys
(cl-loop for entry in
(cl-sort (cl-loop for key in keys collect
(list :key key :year (bibtex-completion-get-value
"year"
(bibtex-completion-get-entry
key))))
(if descending
(lambda (x y)
(> (string-to-number (plist-get x :year))
(string-to-number (plist-get y :year))))
(lambda (x y)
(< (string-to-number (plist-get x :year))
(string-to-number (plist-get y :year))))))
collect
(plist-get entry :key))))
;; now render it
(setq cite-string (concat (format "\\%s" (plist-get data :cite-type))
(or (plist-get data :optional-1) "")
(or (plist-get data :optional-2) "")
(format "{%s}" (s-join "," (plist-get data :keys)))))
(cl--set-buffer-substring (plist-get data :cite-begin)
(plist-get data :cite-end)
cite-string)
(search-forward (car (plist-get data :keys)))
(goto-char (match-beginning 0))))
(provide 'org-ref-latex)
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-misc-links.el --- Miscellaneous links -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2021-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
+5 -5
View File
@@ -1,6 +1,6 @@
;;; org-ref-natbib-bbl-citeproc.el --- A bibtex + natbib BBL-based citeproc -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2021-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
@@ -101,7 +101,7 @@ cover any math (yet)."
(setq p4 (point)
p3 (- (point) 1))
(setq ss (string-trim (buffer-substring p2 p3)))
(setf (buffer-substring p1 p4) (format fmt ss))))
(cl--set-buffer-substring p1 p4 (format fmt ss))))
;; {text} for protecting case. This is tricky to do reliably. I try to check
;; if this is not part of a command, and skip it if so. This leaves
@@ -414,8 +414,8 @@ Argument BACKEND is the export format."
replacement)
p2 (+ 1 (org-element-property :end link))))))
(setf (buffer-substring p1 p2)
(concat replacement (make-string (org-element-property :post-blank link) ? )))))
(cl--set-buffer-substring p1 p2
(concat replacement (make-string (org-element-property :post-blank link) ? )))))
(defun org-ref-bbl-replace-bibliography (bib-link bibdata NATBIB-OPTIONS backend)
@@ -469,7 +469,7 @@ You need a LaTeX file and a bbl file for it. This hook generates
those, then gets the data, replaces the citations and the
bibliography.
"
(let* ((org-export-before-parsing-hook nil)
(let* ((org-export-before-parsing-functions nil)
(tex-file (org-latex-export-to-latex))
(bbl-file (concat (file-name-sans-extension tex-file) ".bbl"))
natbib-options bibdata org-ref-natmove
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-pdf.el --- Drag-n-drop PDF onto bibtex files -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
+2 -2
View File
@@ -1,4 +1,4 @@
(define-package "org-ref" "3.0.0" "citations, cross-references and bibliographies in org-mode"
(define-package "org-ref" "3.1.0" "citations, cross-references and bibliographies in org-mode"
'((dash "0")
(s "0")
(f "0")
@@ -6,7 +6,7 @@
(htmlize "0")
(parsebib "0")
(bibtex-completion "0")
(emacs "26")))
(emacs "29")))
;; Local Variables:
+4 -3
View File
@@ -1,4 +1,4 @@
(define-package "org-ref" "20231101.2355" "citations, cross-references and bibliographies in org-mode"
(define-package "org-ref" "20250301.1918" "citations, cross-references and bibliographies in org-mode"
'((org "9.4")
(dash "0")
(s "0")
@@ -9,8 +9,9 @@
(parsebib "0")
(bibtex-completion "0")
(citeproc "0")
(ox-pandoc "0"))
:commit "195b8d3209aff956ecdd755422700e8517a34d11" :authors
(ox-pandoc "0")
(request "0"))
:commit "edbb80863ef63ef52ef04fce3239e063843f8d30" :authors
'(("John Kitchin" . "jkitchin@andrew.cmu.edu"))
:maintainers
'(("John Kitchin" . "jkitchin@andrew.cmu.edu"))
+1 -1
View File
@@ -1,4 +1,4 @@
;;; org-ref-publish.el --- org-publish with org-ref
;;; org-ref-publish.el --- org-publish with org-ref -*- lexical-binding: t; -*-
;;; Commentary:
;; First draft proposed by madhu 230826 (Madhu <enometh@meer.net>)
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-pubmed.el --- Links and functions for Pubmed and NIH databases -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
+4 -6
View File
@@ -1,6 +1,6 @@
;;; org-ref-ref-links.el --- cross-reference links for org-ref -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 John Kitchin
;; Copyright (C) 2021-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
@@ -162,8 +162,7 @@ font-lock."
(rx (string-join org-ref-ref-label-regexps "\\|"))
(labels '())
oe ;; org-element
context
data)
context)
(save-excursion
(org-with-wide-buffer
(goto-char (point-min))
@@ -221,7 +220,7 @@ font-lock."
(when (string= label (match-string-no-properties 1))
(save-match-data (org-mark-ring-push))
(goto-char (match-beginning 1))
(org-show-entry)
(org-fold-show-entry)
(substitute-command-keys
"Go back with (org-mark-ring-goto) \`\\[org-mark-ring-goto]'.")
(throw 'found t)))))))
@@ -347,8 +346,7 @@ This is meant to be used with `apply-partially' in the link definitions."
;; in a latex environment
((equal (org-element-type object) 'latex-environment)
(let ((value (org-element-property :value object))
label)
(let ((value (org-element-property :value object)))
(when (string-match "\\\\label{\\(?1:[+a-zA-Z0-9:\\._-]*\\)}" value)
(match-string-no-properties 1 value))))
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-sci-id.el --- org-mode links for scientific IDs -*- lexical-binding: t; -*-
;; Copyright (C) 2015 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
+2 -2
View File
@@ -1,6 +1,6 @@
;;; org-ref-scifinder.el --- Emacs interface to SciFinder
;;; org-ref-scifinder.el --- Emacs interface to SciFinder -*- lexical-binding: t; -*-
;; Copyright (C) 2015 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-scopus.el --- Emacs-lisp interface to the Scopus API -*- lexical-binding: t; -*-
;; Copyright (C) 2015 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-url-utils.el --- Utility functions to scrape DOIs from urls -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
+33 -14
View File
@@ -1,6 +1,6 @@
;;; org-ref-utils.el --- Utility functions for org-ref -*- lexical-binding: t; -*-
;; Copyright (C) 2016-2021 John Kitchin
;; Copyright (C) 2016-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
@@ -55,9 +55,11 @@ Copies the string to the clipboard."
(setq org-version (with-temp-buffer
(insert-file-contents org-ref-el)
(goto-char (point-min))
(re-search-forward ";; Version:")
(s-trim (buffer-substring (point)
(line-end-position)))))
(if
(re-search-forward ";; Version:" nil t)
(s-trim (buffer-substring (point)
(line-end-position)))
org-ref-dir)))
(setq git-commit
;; If in git, get current commit
@@ -128,6 +130,12 @@ org-ref installed in [[${org-ref-location}]].
- org-ref-insert-ref-function :: ${org-ref-insert-ref-function}
- org-ref-cite-onclick-function :: ${org-ref-cite-onclick-function}
* bibtex-completion setup
- bibtex-completion-bibliography :: ${bibtex-completion-bibliography}
- bibtex-completion-library-path :: ${bibtex-completion-library-path}
- bibtex-completion-notes-path :: ${bibtex-completion-notes-path}
* org-ref libraries
** org-ref-helm (loaded: ${org-ref-helm-p})
@@ -175,7 +183,11 @@ You set =pdftotext-executable= to ${pdftotext-executable} (exists: ${pdftotext-e
("org-ref-insert-cite-function" . ,org-ref-insert-cite-function)
("org-ref-insert-label-function" . ,org-ref-insert-label-function)
("org-ref-insert-ref-function" . ,org-ref-insert-ref-function)
("org-ref-cite-onclick-function" . ,org-ref-cite-onclick-function)))))
("org-ref-cite-onclick-function" . ,org-ref-cite-onclick-function)
("bibtex-completion-bibliography" . ,bibtex-completion-bibliography)
("bibtex-completion-library-path" . ,bibtex-completion-library-path)
("bibtex-completion-notes-path" . ,bibtex-completion-notes-path)))))
(defun org-ref-get-bibtex-entry-citation (key)
@@ -263,7 +275,10 @@ Jabref, Mendeley and Zotero. See `bibtex-completion-find-pdf'."
(pdf-file (bibtex-completion-find-pdf key t)))
(pcase (length pdf-file)
(0
(message "no pdf found for %s" key))
(message "no pdf found for %s" key)
(save-window-excursion
(org-ref-open-citation-at-point)
(doi-utils-get-bibtex-entry-pdf)))
(1
(funcall bibtex-completion-pdf-open-function (car pdf-file)))
(_
@@ -291,12 +306,12 @@ in a directory. Optional PREFIX argument toggles between
(pdf-file (bibtex-completion-find-pdf-in-library key)))
(if pdf-file
(message "PDF for key [%s] already exists %s" key pdf-file)
(let* (
(source-file-name (read-file-name (format "Select pdf file associated with key [%s]: " key)
org-ref-bibtex-pdf-download-dir))
(dest-file-name (expand-file-name (format "%s.pdf" key) (org-ref-library-path)))
(file-move-func (org-ref-bibtex-get-file-move-func prefix))
)
(let* ((source-file-name (read-file-name
(format "Select pdf file associated with key [%s]: " key)
org-ref-bibtex-pdf-download-dir))
(dest-file-name (expand-file-name (format "%s.pdf" key)
(org-ref-library-path)))
(file-move-func (org-ref-bibtex-get-file-move-func prefix)))
(progn
(funcall file-move-func source-file-name dest-file-name)
(message "added file %s to key %s" dest-file-name key))))))
@@ -591,7 +606,7 @@ if FORCE is non-nil reparse the buffer no matter what."
(cl-loop for ref in (plist-get (org-ref-parse-cite-path (plist-get plist :path)) :references)
do
(when (not (member (plist-get ref :key) bibtex-keys))
(goto-char (plist-get plist :begin))
(goto-char (org-element-property :begin link))
(re-search-forward (plist-get ref :key))
(push (cons (plist-get ref :key) (point-marker)) bad-citations)))))))
;; add with-affiliates to get cites in caption
@@ -615,7 +630,7 @@ if FORCE is non-nil reparse the buffer no matter what."
(cl-loop for label in (split-string (plist-get plist :path) ",")
do
(unless (-contains? labels label)
(goto-char (plist-get plist :begin))
(goto-char (org-element-property :begin link))
(add-to-list
'bad-refs
(cons label (point-marker)))))))))
@@ -1277,3 +1292,7 @@ which will CLOBBER the file."
(provide 'org-ref-utils)
;;; org-ref-utils.el ends here
;; Local Variables:
;; byte-compile-warnings: (not docstrings-wide)
;; End:
+1 -1
View File
@@ -1,4 +1,4 @@
;;; org-ref-worldcat.el --- Worldcat library
;;; org-ref-worldcat.el --- Worldcat library -*- lexical-binding: t; -*-
;;; Commentary:
;; Provides a function to query world cat
+1 -1
View File
@@ -1,6 +1,6 @@
;;; org-ref-wos.el --- Web of Science functions -*- lexical-binding: t; -*-
;; Copyright (C) 2015 John Kitchin
;; Copyright (C) 2015-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords:
+3 -3
View File
@@ -1,12 +1,12 @@
;;; org-ref.el --- citations, cross-references and bibliographies in org-mode -*- lexical-binding: t; -*-
;; Copyright(C) 2014-2021 John Kitchin
;; Copyright(C) 2014-2024 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; URL: https://github.com/jkitchin/org-ref
;; Version: 3.0
;; Version: 3.1
;; Keywords: org-mode, cite, ref, label
;; Package-Requires: ((org "9.4") (dash "0") (s "0") (f "0") (htmlize "0") (hydra "0") (avy "0") (parsebib "0") (bibtex-completion "0") (citeproc "0") (ox-pandoc "0"))
;; Package-Requires: ((org "9.4") (dash "0") (s "0") (f "0") (htmlize "0") (hydra "0") (avy "0") (parsebib "0") (bibtex-completion "0") (citeproc "0") (ox-pandoc "0") (request "0"))
;; This file is not currently part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
+4 -4
View File
@@ -1,4 +1,4 @@
;;; x2bib.el --- Bibliography conversion to Bibtex
;;; x2bib.el --- Bibliography conversion to Bibtex -*- lexical-binding: t; -*-
;;; Header:
@@ -41,7 +41,7 @@
;;; Code:
(require 'bibtex)
(require 'org-ref-core)
;;* RIS to bibtex
@@ -74,7 +74,7 @@ and convert it to bib format in place."
(shell-command-on-region (region-beginning) (region-end)
"ris2xml 2> /dev/null | xml2bib -w 2> /dev/null" nil
t)
nil))))
nil))))
;; make some lines into comments.
(when result
(setq result (replace-regexp-in-string
@@ -136,7 +136,7 @@ Display output if VERBOSE is non-nil."
"Map over bibtex entries and clean them."
(interactive)
(bibtex-map-entries
(lambda (a b c)
(lambda (_ _ _)
(ignore-errors
(org-ref-clean-bibtex-entry)))))
+2 -1
View File
@@ -504,7 +504,7 @@ If optional argument NATURAL-ORDER is non-nil, set the field
This is an auxiliary function for command
`orb-pdf-scrapper-generate-keys'."
(let* ((entry (parsebib-read-entry (parsebib-find-next-item)))
(let* ((entry (parsebib-read-entry))
(key-plist (orb-pdf-scrapper--get-entry-info entry collect-only))
(new-key (plist-get key-plist :key))
(validp (plist-get key-plist :validp))
@@ -1181,6 +1181,7 @@ TYPE is type of data. PROPERTIES are additional export properties."
;; NOTE: Investigate
;; The behaviour of org-insert-heading has changed at some point:
;; If in an empty buffer, e.g. temp-buffer, the function fails messaging "beginning of buffer"
(org-mode)
(org-N-empty-lines-before-current 1)
(org-insert-heading nil nil t)
(insert name)
+3 -3
View File
@@ -1,8 +1,8 @@
(define-package "org-roam-bibtex" "20230628.2036" "Org Roam meets BibTeX"
(define-package "org-roam-bibtex" "20250215.1156" "Org Roam meets BibTeX"
'((emacs "27.1")
(org-roam "2.2.0")
(bibtex-completion "2.0.0"))
:commit "f90ac12b7ae5ba7bcdebfe53796fd0417946e5e1" :authors
(bibtex-completion "1.0.0"))
:commit "b065198f2c3bc2a47ae520acd2b1e00e7b0171e6" :authors
'(("Mykhailo Shevchuk" . "mail@mshevchuk.com")
("Leo Vivier" . "leo.vivier+dev@gmail.com"))
:maintainers
+1 -1
View File
@@ -8,7 +8,7 @@
;; URL: https://github.com/org-roam/org-roam-bibtex
;; Keywords: bib hypermedia outlines wp
;; Version: 0.6.1
;; Package-Requires: ((emacs "27.1") (org-roam "2.2.0") (bibtex-completion "2.0.0"))
;; Package-Requires: ((emacs "27.1") (org-roam "2.2.0") (bibtex-completion "1.0.0"))
;; This file is NOT part of GNU Emacs.
+1 -4
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (emacsql "20230228") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (emacsql "4.1.0") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
@@ -707,8 +707,6 @@ the current value of `point'."
(defun org-roam-capture--finalize ()
"Finalize the `org-roam-capture' process."
(when-let ((region (org-roam-capture--get :region)))
(org-roam-unshield-region (car region) (cdr region)))
(if org-note-abort
(when-let ((new-file (org-roam-capture--get :new-file))
(_ (yes-or-no-p "Delete file for aborted capture?")))
@@ -740,7 +738,6 @@ This function is to be called in the Org-capture finalization process."
(buf (marker-buffer mkr)))
(with-current-buffer buf
(when-let ((region (org-roam-capture--get :region)))
(org-roam-unshield-region (car region) (cdr region))
(delete-region (car region) (cdr region))
(set-marker (car region) nil)
(set-marker (cdr region) nil))
+23 -86
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (emacsql "20230228") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (emacsql "4.1.0") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
@@ -36,43 +36,6 @@
(defvar org-outline-path-cache)
;;; Options
(defcustom org-roam-database-connector (if (and (progn
(require 'emacsql-sqlite-builtin nil t)
(functionp 'emacsql-sqlite-builtin))
(functionp 'sqlite-open))
'sqlite-builtin
'sqlite)
"The database connector used by Org-roam.
This must be set before `org-roam' is loaded. To use an alternative
connector you must install the respective package explicitly.
The default is `sqlite', which uses the `emacsql-sqlite' library
that is being maintained in the same repository as `emacsql'
itself.
If you are using Emacs 29, then the recommended connector is
`sqlite-builtin', which uses the new builtin support for SQLite.
You need to install the `emacsql-sqlite-builtin' package to use
this connector.
If you are using an older Emacs release, then the recommended
connector is `sqlite-module', which uses the module provided by
the `sqlite3' package. This is very similar to the previous
connector and the built-in support in Emacs 29 derives from this
module. You need to install the `emacsql-sqlite-module' package
to use this connector.
For the time being `libsqlite3' is still supported. Do not use
this, it is an older version of the `sqlite-module' connector
from before the connector and the package were renamed.
For the time being `sqlite3' is also supported. Do not use this.
This uses the third-party `emacsql-sqlite3' package, which uses
the official `sqlite3' cli tool, which is not intended
to be used like this. See https://nullprogram.com/blog/2014/02/06/."
:package-version '(forge . "0.3.0")
:group 'org-roam
:type '(choice (const sqlite)
(const sqlite-builtin)
(const sqlite-module)
(const :tag "libsqlite3 (OBSOLETE)" libsqlite3)
(const :tag "sqlite3 (BROKEN)" sqlite3)))
(defcustom org-roam-db-location (locate-user-emacs-file "org-roam.db")
"The path to file where the Org-roam database is stored.
@@ -126,8 +89,9 @@ is desirable to parse and cache these links (e.g. hiding links in
a property drawer)."
:package-version '(org-roam . "2.2.0")
:group 'org-roam
:type '(set (const :tag "keywords" keyword)
(const :tag "property drawers" node-property)))
:type '(set
(const :tag "keywords" keyword)
(const :tag "property drawers" node-property)))
(defcustom org-roam-db-extra-links-exclude-keys '((node-property . ("ROAM_REFS"))
(keyword . ("transclude")))
@@ -155,36 +119,6 @@ ROAM_REFS."
(gethash (expand-file-name (file-name-as-directory org-roam-directory))
org-roam-db--connection))
(declare-function emacsql-sqlite "ext:emacsql-sqlite")
(declare-function emacsql-sqlite3 "ext:emacsql-sqlite3")
(declare-function emacsql-libsqlite3 "ext:emacsql-libsqlite3")
(declare-function emacsql-sqlite-builtin "ext:emacsql-sqlite-builtin")
(declare-function emacsql-sqlite-module "ext:emacsql-sqlite-module")
(defun org-roam-db--conn-fn ()
"Return the function for creating the database connection."
(cl-case org-roam-database-connector
(sqlite
(progn
(require 'emacsql-sqlite)
#'emacsql-sqlite))
(sqlite-builtin
(progn
(require 'emacsql-sqlite-builtin)
#'emacsql-sqlite-builtin))
(sqlite-module
(progn
(require 'emacsql-sqlite-module)
#'emacsql-sqlite-module))
(libsqlite3
(progn
(require 'emacsql-libsqlite3)
#'emacsql-libsqlite3))
(sqlite3
(progn
(require 'emacsql-sqlite3)
#'emacsql-sqlite3))))
(defun org-roam-db ()
"Entrypoint to the Org-roam sqlite database.
Initializes and stores the database, and the database connection.
@@ -193,11 +127,7 @@ Performs a database upgrade when required."
(emacsql-live-p (org-roam-db--get-connection)))
(let ((init-db (not (file-exists-p org-roam-db-location))))
(make-directory (file-name-directory org-roam-db-location) t)
(let ((conn (funcall (org-roam-db--conn-fn) org-roam-db-location)))
(emacsql conn [:pragma (= foreign_keys ON)])
(when-let* ((process (emacsql-process conn))
(_ (processp process)))
(set-process-query-on-exit-flag process nil))
(let ((conn (emacsql-sqlite-open org-roam-db-location)))
(puthash (expand-file-name (file-name-as-directory org-roam-directory))
conn
org-roam-db--connection)
@@ -209,7 +139,7 @@ Performs a database upgrade when required."
((> version org-roam-db-version)
(emacsql-close conn)
(user-error
"The Org-roam database was created with a newer Org-roam version. "
"The Org-roam database was created with a newer Org-roam version. %s"
"You need to update the Org-roam package"))
((< version org-roam-db-version)
(emacsql-close conn)
@@ -374,12 +304,12 @@ If HASH is non-nil, use that as the file's hash without recalculating it."
(defun org-roam-db-get-scheduled-time ()
"Return the scheduled time at point in ISO8601 format."
(when-let ((time (org-get-scheduled-time (point))))
(org-format-time-string "%FT%T%z" time)))
(format-time-string "%FT%T" time)))
(defun org-roam-db-get-deadline-time ()
"Return the deadline time at point in ISO8601 format."
(when-let ((time (org-get-deadline-time (point))))
(org-format-time-string "%FT%T%z" time)))
(format-time-string "%FT%T" time)))
(defun org-roam-db-node-p ()
"Return t if headline at point is an Org-roam node, else return nil."
@@ -407,7 +337,7 @@ If HASH is non-nil, use that as the file's hash without recalculating it."
(let* ((begin (match-beginning 0))
(element (org-element-context))
(type (org-element-type element))
link bounds)
link)
(cond
;; Links correctly recognized by Org Mode
((eq type 'link)
@@ -570,12 +500,18 @@ INFO is the org-element parsed buffer."
"Insert link data for LINK at current point into the Org-roam cache."
(save-excursion
(goto-char (org-element-property :begin link))
(let ((type (org-element-property :type link))
(path (org-element-property :path link))
(source (org-roam-id-at-point))
(properties (list :outline (ignore-errors
;; This can error if link is not under any headline
(org-get-outline-path 'with-self 'use-cache)))))
(let* ((type (org-element-property :type link))
(path (org-element-property :path link))
(option (and (string-match "::\\(.*\\)\\'" path)
(match-string 1 path)))
(path (if (not option) path
(substring path 0 (match-beginning 0))))
(source (org-roam-id-at-point))
(properties (list :outline (ignore-errors
;; This can error if link is not under any headline
(org-get-outline-path 'with-self 'use-cache))))
(properties (if option (plist-put properties :search-option option)
properties)))
;; For Org-ref links, we need to split the path into the cite keys
(when (and source path)
(if (and (boundp 'org-ref-cite-types)
@@ -645,7 +581,8 @@ in `org-roam-db-sync'."
(emacsql-with-transaction (org-roam-db)
(org-with-wide-buffer
(org-set-regexps-and-options 'tags-only)
(org-refresh-category-properties)
;; Org doesn't use this anymore, so we probably should stop too.
;; (org-refresh-category-properties)
(org-roam-db-clear-file)
(org-roam-db-insert-file content-hash)
(org-roam-db-insert-file-node)
+1 -1
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (org "9.4") (org-roam "2.1"))
;; Package-Requires: ((emacs "26.1") (org "9.6") (org-roam "2.1"))
;; This file is NOT part of GNU Emacs.
+1 -1
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (org "9.4") (org-roam "2.1"))
;; Package-Requires: ((emacs "26.1") (org "9.6") (org-roam "2.1"))
;; This file is NOT part of GNU Emacs.
+8 -31
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
@@ -55,40 +55,17 @@ With optional argument MARKERP, return the position as a new marker."
(let ((node (org-roam-populate (org-roam-node-create :id id))))
(when-let ((file (org-roam-node-file node)))
(if markerp
(unwind-protect
(let ((buffer (or (find-buffer-visiting file)
(find-file-noselect file))))
(with-current-buffer buffer
(move-marker (make-marker) (org-roam-node-point node) buffer))))
(let ((buffer (or (find-buffer-visiting file)
(find-file-noselect file))))
(with-current-buffer buffer
(move-marker (make-marker) (org-roam-node-point node) buffer)))
(cons (org-roam-node-file node)
(org-roam-node-point node))))))
(defun org-roam-id-open (id _)
"Go to the entry with id ID.
Like `org-id-open', but additionally uses the Org-roam database."
(org-mark-ring-push)
(let ((m (or (org-roam-id-find id 'marker)
(org-id-find id 'marker)))
cmd)
(unless m
(error "Cannot find entry with ID \"%s\"" id))
;; Use a buffer-switching command in analogy to finding files
(setq cmd
(or
(cdr
(assq
(cdr (assq 'file org-link-frame-setup))
'((find-file . switch-to-buffer)
(find-file-other-window . switch-to-buffer-other-window)
(find-file-other-frame . switch-to-buffer-other-frame))))
'switch-to-buffer-other-window))
(if (not (equal (current-buffer) (marker-buffer m)))
(funcall cmd (marker-buffer m)))
(goto-char m)
(move-marker m nil)
(org-show-context)))
(defalias 'org-roam-id-open 'org-id-open
"Obsolete alias - use `org-id-open' directly.")
(org-link-set-parameters "id" :follow #'org-roam-id-open)
(advice-add 'org-id-find :before-until #'org-roam-id-find)
;;;###autoload
(defun org-roam-update-org-id-locations (&rest directories)
+1 -1
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (emacsql "20230228") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (emacsql "4.1.0") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
+1 -1
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (emacsql "20230228") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (emacsql "4.1.0") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
+25 -18
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (emacsql "20230228") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (emacsql "4.1.0") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
@@ -42,8 +42,8 @@
(defcustom org-roam-mode-sections (list #'org-roam-backlinks-section
#'org-roam-reflinks-section)
"A list of sections for the `org-roam-mode' based buffers.
Each section is a function that is passed the an `org-roam-node'
for which the section will be constructed for as the first
Each section is a function that is passed the `org-roam-node'
for which the section will be constructed as the first
argument. Normally this node is `org-roam-buffer-current-node'.
The function may also accept other optional arguments. Each item
in the list is either:
@@ -319,7 +319,7 @@ To toggle its display use `org-roam-buffer-toggle' command.")
(define-inline org-roam-buffer--visibility ()
"Return the current visibility state of the persistent `org-roam-buffer'.
Valid states are 'visible, 'exists and 'none."
Valid states are `visible', `exists' and `none'."
(declare (side-effect-free t))
(inline-quote
(cond
@@ -441,7 +441,7 @@ In interactive calls OTHER-WINDOW is set with
(with-current-buffer buf
(widen)
(goto-char point))
(when (org-invisible-p) (org-show-context))
(when (org-invisible-p) (org-fold-show-context))
buf))
(defun org-roam-preview-default-function ()
@@ -514,17 +514,20 @@ Sorts by title."
(string< (org-roam-node-title (org-roam-backlink-source-node a))
(org-roam-node-title (org-roam-backlink-source-node b))))
(cl-defun org-roam-backlinks-section (node &key (unique nil) (show-backlink-p nil))
(cl-defun org-roam-backlinks-section (node &key (unique nil) (show-backlink-p nil)
(section-heading "Backlinks:"))
"The backlinks section for NODE.
When UNIQUE is nil, show all positions where references are found.
When UNIQUE is t, limit to unique sources.
When SHOW-BACKLINK-P is not null, only show backlinks for which
this predicate is not nil."
this predicate is not nil.
SECTION-HEADING is the string used as a heading for the backlink section."
(when-let ((backlinks (seq-sort #'org-roam-backlinks-sort (org-roam-backlinks-get node :unique unique))))
(magit-insert-section (org-roam-backlinks)
(magit-insert-heading "Backlinks:")
(magit-insert-heading section-heading)
(dolist (backlink backlinks)
(when (or (null show-backlink-p)
(and (not (null show-backlink-p))
@@ -627,7 +630,7 @@ instead."
(forward-line (1- row)))
(when col
(forward-char (1- col))))
(when (org-invisible-p) (org-show-context))
(when (org-invisible-p) (org-fold-show-context))
buf))
;;;; Unlinked references
@@ -655,6 +658,18 @@ This is the ROW within FILE."
(end-of-line)
(point)))))
(defun org-roam-unlinked-references--rg-command (titles)
"Return the ripgrep command searching for TITLES."
(concat "rg --follow --only-matching --vimgrep --pcre2 --ignore-case "
(mapconcat (lambda (glob) (concat "--glob " glob))
(org-roam--list-files-search-globs org-roam-file-extensions)
" ")
(format " '\\[([^[]]++|(?R))*\\]%s' "
(mapconcat (lambda (title)
(format "|(\\b%s\\b)" (shell-quote-argument title)))
titles ""))
(shell-quote-argument org-roam-directory)))
(defun org-roam-unlinked-references-section (node)
"The unlinked references section for NODE.
References from FILE are excluded."
@@ -664,15 +679,7 @@ References from FILE are excluded."
(shell-command-to-string "rg --pcre2-version"))))
(let* ((titles (cons (org-roam-node-title node)
(org-roam-node-aliases node)))
(rg-command (concat "rg -L -o --vimgrep -P -i "
(mapconcat (lambda (glob) (concat "-g " glob))
(org-roam--list-files-search-globs org-roam-file-extensions)
" ")
(format " '\\[([^[]]++|(?R))*\\]%s' "
(mapconcat (lambda (title)
(format "|(\\b%s\\b)" (shell-quote-argument title)))
titles ""))
org-roam-directory))
(rg-command (org-roam-unlinked-references--rg-command titles))
(results (split-string (shell-command-to-string rg-command) "\n"))
f row col match)
(magit-insert-section (unlinked-references)
+30 -22
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.4") (magit-section "3.0.0"))
;; Package-Requires: ((emacs "26.1") (dash "2.13") (org "9.6") (magit-section "3.0.0"))
;; This file is NOT part of GNU Emacs.
@@ -32,6 +32,7 @@
;; interactively.
;;
;;; Code:
(require 'crm)
(require 'org-roam)
;;; Options
@@ -256,17 +257,21 @@ Return nil if a node with ID does not exist."
id)) 0)
(org-roam-populate (org-roam-node-create :id id))))
(defun org-roam-node-from-title-or-alias (s)
(defun org-roam-node-from-title-or-alias (s &optional nocase)
"Return an `org-roam-node' for the node with title or alias S.
Return nil if the node does not exist.
Throw an error if multiple choices exist."
Throw an error if multiple choices exist.
If NOCASE is non-nil, the query is case insensitive. It is case sensitive otherwise."
(let ((matches (seq-uniq
(append
(org-roam-db-query [:select [id] :from nodes
:where (= title $s1)]
(org-roam-db-query (vconcat [:select [id] :from nodes
:where (= title $s1)]
(if nocase [ :collate NOCASE ]))
s)
(org-roam-db-query [:select [node-id] :from aliases
:where (= alias $s1)]
(org-roam-db-query (vconcat [:select [node-id] :from aliases
:where (= alias $s1)]
(if nocase [ :collate NOCASE ]))
s)))))
(cond
((seq-empty-p matches)
@@ -305,7 +310,8 @@ Return nil if there's no node with such REF."
Uses the ID, and fetches remaining details from the database.
This can be quite costly: avoid, unless dealing with very few
nodes."
(when-let ((node-info (car (org-roam-db-query [:select [file level pos todo priority
(when-let ((node-info (car (org-roam-db-query [:select [
file level pos todo priority
scheduled deadline title properties olp]
:from nodes
:where (= id $s1)
@@ -413,8 +419,9 @@ FROM
GROUP BY id, tags )
GROUP BY id")))
(cl-loop for row in rows
append (pcase-let* ((`(,id ,file ,file-title ,level ,todo ,pos ,priority ,scheduled ,deadline
,title ,properties ,olp ,atime ,mtime ,tags ,aliases ,refs)
append (pcase-let* ((`(
,id ,file ,file-title ,level ,todo ,pos ,priority ,scheduled ,deadline
,title ,properties ,olp ,atime ,mtime ,tags ,aliases ,refs)
row)
(all-titles (cons title aliases)))
(mapcar (lambda (temp-title)
@@ -440,12 +447,11 @@ GROUP BY id")))
;;;; Finders
(defun org-roam-node-marker (node)
"Get the marker for NODE."
(unwind-protect
(let* ((file (org-roam-node-file node))
(buffer (or (find-buffer-visiting file)
(find-file-noselect file))))
(with-current-buffer buffer
(move-marker (make-marker) (org-roam-node-point node) buffer)))))
(let* ((file (org-roam-node-file node))
(buffer (or (find-buffer-visiting file)
(find-file-noselect file))))
(with-current-buffer buffer
(move-marker (make-marker) (org-roam-node-point node) buffer))))
(defun org-roam-node-open (node &optional cmd force)
"Go to the node NODE.
@@ -472,7 +478,7 @@ NODE, unless FORCE is non-nil."
(org-roam-id-at-point))))
(goto-char m))
(move-marker m nil))
(org-show-context))
(org-fold-show-context))
(defun org-roam-node-visit (node &optional other-window force)
"From the current buffer, visit NODE. Return the visited buffer.
@@ -874,6 +880,7 @@ node."
(org-with-point-at 1
(let ((title (nth 4 (org-heading-components)))
(tags (org-get-tags)))
(org-fold-show-all)
(kill-whole-line)
(org-roam-end-of-meta-data t)
(insert "#+title: " title "\n")
@@ -882,14 +889,15 @@ node."
(org-roam-db-update-file))))
;;;###autoload
(defun org-roam-refile ()
"Refile node at point to an Org-roam node.
(defun org-roam-refile (node)
"Refile node at point to an org-roam NODE.
If region is active, then use it instead of the node at point."
(interactive)
(interactive
(list (org-roam-node-read nil nil nil 'require-match)))
(let* ((regionp (org-region-active-p))
(region-start (and regionp (region-beginning)))
(region-end (and regionp (region-end)))
(node (org-roam-node-read nil nil nil 'require-match))
(file (org-roam-node-file node))
(nbuf (or (find-buffer-visiting file)
(find-file-noselect file)))
@@ -1049,7 +1057,7 @@ and when nil is returned the node will be filtered out."
(let ((node (org-roam-node-at-point 'assert)))
(save-excursion
(goto-char (org-roam-node-point node))
(org-roam-property-add "ROAM_REFS" (if (memq " " (string-to-list ref))
(org-roam-property-add "ROAM_REFS" (if (member " " (string-to-list ref))
(concat "\"" ref "\"")
ref)))))
+1 -1
View File
@@ -6,7 +6,7 @@
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 2.2.2
;; Package-Requires: ((emacs "26.1") (org "9.4") (org-roam "2.1"))
;; Package-Requires: ((emacs "26.1") (org "9.6") (org-roam "2.1"))
;; This file is NOT part of GNU Emacs.

Some files were not shown because too many files have changed in this diff Show More