Skip to main content

Questions tagged [string]

A string is a sequence of characters, which can be user data or used internally in Emacs. For example, string to search, replace, save in a register and so on, file name, etc.

1 vote
1 answer
99 views

How would you remove all emojis from string?

Basically what the title says, I'm looking for the best way to remove all emojis from a string.
thanosapollo's user avatar
4 votes
2 answers
413 views

Filter a list of strings to create a separate list of those that match a given prefix

If I have a list, (“apple” “pear” “grape” “apricot”) how do I create a new list with elements starting with the letter “a”? The new list will be: (“apple” “apricot”).
zeynel's user avatar
  • 371
0 votes
0 answers
24 views

How to programmatically set the same flag for multiple transient-values? [duplicate]

How can I programmatically set the same argument (e.g., --gpg-sign=abc123) for multiple transient-values? If I try the following, it seems that the value of adamliter/my-gpg-key-sign-git-arg does not ...
Adam Liter's user avatar
3 votes
1 answer
58 views

Strange behaviour involving `display` property

I noticed a rather peculiar behavior when using the display property (using emacs 28.2). I tried to boil things down to a minimal example: The code (defun finsert () (insert (propertize ".&...
dmw64's user avatar
  • 187
1 vote
1 answer
172 views

replace nth-match of a regexp in a string

I'm looking for a function that can replace the nth-match in a string. Here's an example. 2 is the index of the nth-match, [0-9]+ is the regular expression to search. foo is the replacement and "...
Rodrigo Morales's user avatar
1 vote
0 answers
39 views

print hex-code in string

I hope "*ielm*"/eval-print-last-sexp print "\x80", but the result is ELISP> "😅\x80" "😅\200" ; Unicode characters should be displayed normally. My current ...
shynur's user avatar
  • 5,578
1 vote
1 answer
118 views

How to return "string" after changing it's text properties?

When using the propertize function alone on an entire string, it works. How to return a string, after changing its different sections separately with add-face-text-property (probably later repeatedly ...
Herman's user avatar
  • 57
0 votes
1 answer
72 views

Is there a literal-string version of "looking-at"?

The function looking-at matches a regex, in some cases however I want to match against a literal string. While (looking-at (regexp-quote text)) works, it seems like there might be a way to do this ...
ideasman42's user avatar
  • 8,935
2 votes
2 answers
190 views

Marking as safe all possible lists of strings

Following this answer, I put the following lines in a .dir-locals.el file: ((latex-mode (TeX-engine . default) (mode . latex ) (TeX-master . "main") (ispell-buffer-session-localwords ...
tigerjack's user avatar
  • 163
0 votes
0 answers
42 views

How to split org-roam-capture-templates in to multiple lines? [duplicate]

I have following config for my org-roam: (use-package org-roam :ensure t :init (setq org-roam-v2-ack t) :custom (org-roam-directory "~/roamnotes") (org-roam-completion-everywhere ...
Garid's user avatar
  • 686
3 votes
1 answer
144 views

Face Text Property: void, nil, default

A string may hold a nil or default face text property, or its face text property is simply unspecified. E.g., #("void nil default" 0 4 ; unspecified () 5 8 ; nil face (...
shynur's user avatar
  • 5,578
-1 votes
1 answer
57 views

How to convince emacs to interpret string of any characters as string

I want to insert this template: << prints("on_%s.gd:"%name, "msg: %s"%msg); >> How to convince emacs it's a string?
VanDeiMin's user avatar
1 vote
1 answer
40 views

String’s Elements Occupy 1/4 Space of Vector’s

In the GNU Emacs Lisp Reference Manual, 6.2 Arrays: In practice, we always choose strings for such applications, for four reasons: They occupy one-fourth the space of a vector of the same elements. ...
shynur's user avatar
  • 5,578
0 votes
1 answer
52 views

Why is my simple use of shell-command to change a global keybinding in Linux not working?

I want to be able to change a global keybinding by calling an Emacs function. The command in question is: gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']&...
Orixi's user avatar
  • 5
1 vote
1 answer
133 views

Org mode agenda custom command that can match on one of multiple property values

The "Advanced Search" Org mode tutorial on Worg provides the following example to find all entries with either "Walter" or "Evensong" in the author field: BIB_TITLE={...
Snelephant's user avatar

15 30 50 per page
1
2 3 4 5
11