texts: How to remove all labels from a topic in forge

texts:
How can I remove all labels from an issue or PR in forge? When I trigger the edit-label minibuffer and clear its contents, then hit enter, the labels are not removed.
I can see that forge is first pulling topics (from GitHub?), then storing topics (locally?), and then running fetch:
Pulling jidicula/dotfiles...done
Storing jidicula/dotfiles...done
Running /usr/local/bin/git fetch origin --prune --tags

Is it possible to remove all labels from a topic?


texts: Associate Emacs with 7zip for .odt export?

texts:
After asking this question, I have downloaded 7zip for Windows.

When I try to export to .odt, I am still getting this: "OpenDocument export failed: Executable "zip" needed for creating OpenDocument files."

What is my next step?


texts: How to update frame-title-format and also the current frame title?

texts:
I am developing an Emacs package that applies when Emacs is used as a server. It should set the frame title when activated, and also when receiving certain commands from Emacsclient.

The package adds the current project name and the buffer file name to the frame title. The problem is that using set-frame-parameter does not allow the frame title to vary with the current buffer name. So I decided to try setting frame-title-format instead, but then the title is not updated before a new frame is opened, or I change to another buffer in the current frame. For example:

(defvar my-project-name "project A")

(defun my-set-title ()
  (let ((name
         (if buffer-file-name
             (buffer-file-name)
           (buffer-name))))
    (concat my-project-name " : " name)))

(setq frame-title-format '(:eval (my-set-title)))

Now, in order to update the frame title to reflect a new project name, I used:

(setq my-project-name "project B")
(set-frame-parameter nil 'title "dummy")
(set-frame-parameter nil 'title nil)

The reason for first setting the title to a dummy value and then resetting it to nil is to also update the title for the current buffer in the current frame immediately. But I could not find this trick in the documentation, so is this going to  work in general?


texts: Encode non-html characters to html equivalent?

texts: I must be overlooking something obvious, but I can't find a way to encode a string/region into HTML, for example "Hölle" to "H&ouml;lle". Is there anything in emacs or web-mode or any other plugin that can do that?


texts: How show and filter search text interactively in separate buffer?

texts:
Emacs 26.1

Suppose I find any text in buffer:

C-s
find_text_1
Input Enter
C-s
find_text_2
Input Enter

So if I want to again find text find_text_1 I press C-s then M-p.
OK. It's work. Nice.
If I want to sea all search texts I press C-M-i. But when I select some text it print this text in buffer. But I need to search text (not print).

But suppose I has 20 search texts in minibuffer history.
So if I need to find e.g. second text (2/20) I need to press M-p 18 times.
It's not very good. And it's very slow.

The question is:
Is it possible to show buffer that contain all Isearch find text?
And I want to filter them on fly (interactively).

Is it possible?


texts: Emacs reads the server file, before executing the command

texts:
I use Emacs as server instance.

When I start EMacs Client, he will check if the file .emacs.d/server/server exists. If not so, then he will initiating a Emacs server instance, and my Emacs configuration files will be loaded.

Then I start a new Emacs Client. He checks that the server-file already exists. The Emacs configuration will not be loaded again, but it will create a new frame instead, connected with the Emacs server instance. It loads really fast.

If I close the Emacs instance properly, the file server will be deleted. But sometimes my Emacs crashes (it happens a lot, because I configure my Emacs like a crazy, believe me).

Then I start Emacs client again, after killing it in Windows. He sees the Emacs server file already exists, but he cannot find the Emacs instance server, to create a frame from it.

So I decided to automatically delete the server-file, every time that Emacs file is being loaded (it's being loaded only when Emacs starts as server instance).

So I created the following:

(add-hook before-init-hook '(shell-command "c:/Dropbox/Sys/autohotkey/delete-server-file-emacs.ahk"))
(require 'server)
(unless (server-running-p)
  (server-start))

This is an AHK-script, that deletes the server file every time when the Emacs configuration is being read.

When I start the Emacs instance, while the server file still in the folder, he still tries to read the server-file first, before execute the autohotkey script.

I stil got the message that there no connection from emacsclient could be made, because the target machine actively refused it. So that means he is reading the server file, that means that there is a Emacs instance as server to connect with it.

Any suggestion, in order to solve this?


texts: I have a very annoying bug in my isearch behaviour; the buffer gets indented (modified) when I enter the first letter during isearch. I've checked all hooks named isearch.*hook but I can't find anything that differs from Vanilla Emacs. I think it only happens in auto-indent-mode. I need ideas on how to track down such bugs and this one in particular.


texts: mode-line-inactive after system window loses focus

texts:
When a system/X11 window (frame) with Emacs loses focus, how can I make its mode line become mode-line-inactive? It stays active, keeping the standard mode-line look/face…

Shouldn’t it be the default? Seems pretty natural.


texts: Different face for checked-off items in plain lists?

texts:
Q: how can I get a different face for checked-off items in org plain lists?

I use org-mode's plain lists a lot:

- [X] item 1
- [ ] item 2
- [ ] item 3
- [ ] item 4, with a whole lot of text that makes this item
  span more than one line

The problem is that I find that the checkboxes do not give enough visual cues that I
have or have not completed an item.

Is there a way to apply a
different face to checked-off list items (in the example, "item
1") while leaving the face alone for non-checked items?

A built-into-org way to do so would be ideal, but if I need to
roll my own functionality, a complicating feature is that my items
often span more than one line (as with "item 4...").  How can I do this?


texts: Open 4 or any number of files in rectangles (dired open all in splits)

texts:
When you have a dired buffer open and it's listing 4 files in a directory,
is there a way to 'open all' the files, and be able to see all the files as 4 split windows in emacs.


texts:
I want to get a list of recently finished things out of org mode. org-agenda and org-agenda-sorting-strategy seem like the way to go, however none of the options (see describe-variable on this) seem to be pay attention to org-clock. Clocking information is the only real time entry that a lot of the things I do have.

Is there an easy way to get a list of finished tasks ordered by when they were last clocked?

org-agenda-log-mode is one approach, but this gives me duplicate entries.


texts: How to make a file variable buffer local?

texts:
I have customized the variable sh-indentation with 4, but in one file I would like to use a different value. So I defined a file variable:

# -*- mode: sh; sh-indentation: 2; -*-

But the result is not what I have expected. When I open the file the values are:

sh-indentation is a variable defined in `sh-script.el'.
Its value is 2
Original value was 4
Local in buffer .szi; global value is 4

The file variable seems to set the global value but not the buffer local value.

How can I set the buffer local value with the file variable?


texts: How to make all abbrev table case sensitive?

texts:
I know that I can use

(abbrev-table-put c++-mode-abbrev-table :case-fixed t)

to make one abbrev table to be case sensitive. But how can I make this default for all abbrev-tables ?


texts:
Not just parenthesis, but any surround. We are given the advantage of a pair being made and the cursor conveniently placed within. That's only 1/2 the procedure; what about jumping out?

Previous (which covers only parens): how-do-i-jump-out-of-enclsing-parentheses

Evil mode in Spacemacs. Thanks.

EDIT: okay, 'pair' instead of 'surround' keyword:

A elisp function to jump between matched pair


texts: How to disable underlining of highlighted matching brackets?

texts:
I want to have no underlining on highlighted matching brackets. I've done the following to achieve that:

M-x customize-face
show-paren-match

And there I deactivated the underlining of matching parenthesis. However, when I restart emacs the underlining in that same setting is checked again. It seems I can't turn it off forever by changing it this way.

How do I turn it off?

If you look at this screenshot, you can see some teal underlining below the brackets:

It's also in other files, not only on that settings buffer. In my init file I already have these lines:

 '(cursor ((t (:background "gold" :foreground "#151718"))))
 '(show-paren-match ((t (:background "yellow green" :foreground "black"))))
 '(show-paren-mismatch ((t (:underline (:color "#CE4045" :style wave))))))

So I do want a red wave below brackets, which have no counterpart, but none on the matching ones.


texts: Terminal cursor movement stutters when mouse cursor is hovered over terminal

texts:
I using emacs-nox with Ubuntu 16.04LTS.

The problem I'm facing is that whenever my mouse cursor is hovering over the terminal window, I experience very stuttery cursor movement.

As you can see in the first gif the mouse cursor is rapidly blinking on and off.

Perhaps it is because I have my cursor movement keys bound to the Alt key.

Up = Alt-i Down = Alt-k Left = Alt-j Right = Alt-l

Does anyone know how to go about fixing this annoyance, or perhaps a work-around?


texts:
I would like to combine flyspell-region with writegood-mode, but writegood-mode does not provide a function to check a region of text.
This is what I came up with to work around the limitation:
(defun writegood-region (beginning end)
  "Check style between BEGINNING and END."
  (interactive "r")
  (narrow-to-region beginning end)
  (writegood-mode)
  (widen))

(defun prose-check-region (beginning end)
  "Check spelling and style between BEGINNING and END."
  (interactive "r")
  (when (use-region-p)
    (writegood-region beginning end)
    (flyspell-region beginning end)
    (setq deactivate-mark t)))

The problem is that writegood-mode remains enabled after the function writegood-region returns.
Any ideas?
Cross-posted: https://github.com/bnbeckwith/writegood-mode/issues/30


texts: Emacs adding comment char when using auto-fill-wrap

texts:
I'm pretty new to emacs, so this might be a stupid question but

I have auto word wrap enabled like so:

(setq-default auto-fill-function 'do-auto-fill)

But when I try to use it in C files, It inserts a * before the wrapped line like a comment.

blah blah blah over the line limit

to

blah blah blah
*over the line limit

Weirdly enough, pressing enter on a comment does not add the star, which is disappointing.This does not happen in viml files (only in c and java files?)


texts:
I am looking for a solution for recently visited files and/or directories by applications run in gnome terminal here

When I saw that question I thought of Emacs. Emacs has recentf-mode, does that mean that if I open a shell buffer by M-xshell or M-xterm, all the files I visited by calling specific programs (e.g. evince for pdf, emacs for text files) from the shell buffer, will be recorded by the recentf-mode and accessed by recentf-open-files?

What kind of "visit" is qualified to be recorded?


texts: Is there some way to view the HTML part of an email in an external browser or as a PDF in notmuch?

texts: I have just started using notmuch for email. I was wondering if there is some way I can view the HTML part of an email in an external browser or rendered to a pdf and viewed inside Emacs (like you can do with mu4e)?


texts:
I'm trying to see if all the values in a list are truthy. For some reason, (apply #'and lst) errors with:

  Invalid function: and

This also happens when I try (cl-reduce #'and lst).

However, (apply #'max lst) seems to work fine.

Right now, I'm using (eval `(and ,@lst)), but that feels ugly.


texts: Trouble installing elpy (totally newb to both emacs and programming)

texts:
I'm having trouble fully installing elpy. I supposedly installed it using emacs' GUI as you can see here.
I tried testing whether it works or not by trying to run Eratosthenes's sieve algorithm as recommended in Jon Fincher's tutorial but as you can see I did not receive the same syntax error line (red line underneath code) as pictured here.
Currently I do not have a working init.el file, instead I have a .emacs file located in c:\users<username> which is where I set my HOME environment path to. The actual \bin is located in c:\users<username>\documents\emacs-26.3-x86_64\bin.
Currently when I try to run the sieve.py file in emacs I get two errors: The first is:
eldoc error: (error Elpy failed to create its dedicated virtualenv. Please check the '*elpy-virtualenv*' buffer.)

I look inside the buffer and it says the following:
Running 'c:/WINDOWS/py.exe -m venv c:/Users/<username>/.emacs.d/elpy/rpc-venv':
Error: Command '['c:\\Users\\Robby Parliament\\.emacs.d\\elpy\\rpc-venv\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101.
Elpy failed to install its dedicated virtualenv due to the above error. If the error details does not help you fixing it, You can report this problem on Elpy repository on github. In the meantime, setting the 'elpy-rpc-virtualenv-path' option to either 'global' or 'current' should temporarily fix the issue.
Then I see a flymake message in the buffer and it says
    Warning [flymake sieve.py]: Disabling backend python-flymake because (error Cannot find a
    suitable checker)

    Warning [flymake sieve.py]: Disabling backend flymake-proc-legacy-flymake because (error Can’t
    find a suitable init function

I do not have an init.el file but I do have a .emacs file in which it contains the following:
    ;; Added by Package.el.  This must come before configurations of
    ;; installed packages.  Don't delete this line.  If you don't want it,
    ;; just comment it out by adding a semicolon to the start of the line.
    ;; You may delete these explanatory comments.
    (package-initialize)

    (custom-set-variables
    ;; custom-set-variables was added by Custom.
    ;; If you edit it by hand, you could mess it up, so be careful.
    ;; Your init file should contain only one such instance.
    ;; If there is more than one, they won't work right.
    '(ansi-color-faces-vector
     [default default default italic underline success warning error])
     '(ansi-color-names-vector
       ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
    '(custom-enabled-themes (quote (dracula)))
    '(custom-safe-themes
     (quote
     ("b46ee2c193e350d07529fcd50948ca54ad3b38446dcbd9b28d0378792db5c088" default)))
     '(display-line-numbers t)
     '(package-archives
       (quote
      (("gnu" . "https://elpa.gnu.org/packages/")
      ("melpa" . "http://stable.melpa.org/packages/"))))
     '(package-selected-packages (quote (elpy dracula-theme)))
    '(ring-bell-function (quote ignore))
    '(visible-bell nil))
    (custom-set-faces
    ;; custom-set-faces was added by Custom.
    ;; If you edit it by hand, you could mess it up, so be careful.
    ;; Your init file should contain only one such instance.
    ;; If there is more than one, they won't work right.
    )
    '(setq visible-bell 1)
    (elpy-enable)


texts: Emacs client doesn't connect to running server on Windows

texts:
I have fresh new installation of emacs altogether with spacemacs. I set env vars for alternate editor and server file. My server file after starting emacs looks like:

127.0.0.1:64518 11948
'M.P$#NT[Q~>U`12i^zhRdA0#B&HJ`7T-9.{G`tl%M+|?l4sE2gGt8w|Aao0:,.O

However, if I'm trying to run emacsclient.exe (the same for emacsclientw.exe) I get a new emacs frame.
What am I doing wrong? What shall I check in order to diagnose the issue?


texts:
Let's say have the following list foo:
(setq foo '(cat dog rat bar))

When I iterate over it using say dolist, I get an extra nil:
(dolist (ele foo)
  (print ele))
cat

dog

rat

bar
nil

Why is there the extra nil ? Shouldn't dolist only iterate over the list the lenght times? (Over each element)
Of course having seen dotimes in the documentation along with dolist I tried to use that as well:
(dotimes (i (length foo))
  (print (nth i))))
cat

dog

rat

bar
nil

I also tried (- (length foo) 1)
cat

dog

rat
nil

So here are my questions

Shouldn't nil be omitted in all cases?
Is there a way I can omit that nil (and iterate over all elements)
I have a feeling that this something to do with linked lists. Can you please explain the missing concept?

Note: I am quite new to elisp and lisp in general. Please be gentle while commenting and answering.
I actually am iterating over an alist and accessing the keys and values using car and cdr.


texts: Enable org-mode column-view for nested TODO list by default

texts:
I'm trying to setup time estimation in TODO lists via column mode
as describled in http://orgmode.org/manual/Effort-estimates.html#Effort-estimates.
The thing that bothers me is that I have to enable column-view each time to see the columns via org-columns and org-agenda-columns. I would like to add a tag to the head TODO entry and enable the column view for entries with that tag when the file is loaded automatically.
I wonder weather there is some command for that already or something that is related?


texts: How to export org mode to html using Google Fonts & CSS?

texts:
I'm trying to change the headers and body fonts of HTML exported from org files. The idea is to have Bebas Neue for headers and Lato for body (both are available through Google fonts).
first I associated my org file to a customized CSS file I found:
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="./assets/style.css"/>

Then I added/replaced the following blocks to the CSS :
Google font import
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

Font variables setting
@import "normalize";
@import "htmlize";
$bebas: 'Bebas Neue', cursive;
$lato: 'Lato', sans-serif;
$monospace: Lucida Console, monospace;
$code-size: 80%;
$smaller: 90%;
$max-width: 710px;

Body
body {
    width: 95%;
    margin: 2% auto;
    font-size: 14px;
    line-height: 1.4em;
    font-family: $lato;
    color: #333;
}

Headers
h1,h2,h3,h4,h5,h6 {
    color: #A5573E;
    line-height: 1em;
    font-family: $bebas;
    text-transform: uppercase;
}

Fonts don't change at all and I don't understand why..


texts: In an orgmode clock report table, how do I sum a column that was computed with another formula?

texts:
Suppose I have some headlines that look like this.

* TODO Parent
** TODO Sub Head1
   CLOCK: [2015-02-09 Mon 07:00]--[2015-02-09 Mon 07:08] =>  0:08
*** TODO Sub Sub Head
    CLOCK: [2015-02-09 Mon 19:20]--[2015-02-09 Mon 19:24] =>  0:04
** TODO Sub Head2
   CLOCK: [2015-02-09 Mon 07:08]--[2015-02-09 Mon 07:11] =>  0:03

Now, if I have a clock table report defined like this.

#+BEGIN: clocktable :maxlevel 2 :scope file :formula "$4='(random)::@2$4='(vsum @3$4)"

I have a custom formula that computes a value. To illustrate my problem, I've used (random) as a way to populate a column. How do I then sum up the results?

| Headline           | Time   |      |                     |
|--------------------+--------+------+---------------------|
| *Total time*       | *0:15* |      |              #ERROR |
|--------------------+--------+------+---------------------|
| TODO Parent        | 0:15   |      |  796400794509121126 |
| \__ TODO Sub Head1 |        | 0:12 | 2086072072269781784 |
| \__ TODO Sub Head2 |        | 0:03 | 1733653844633948893 |

I've used the formula debugger C-f { and I can see that my vsum invocation is receiving the cell values as propertized strings. Is there a way to compute that sum and lay it down in that cell where the #ERROR resides?


texts: Magit magit-diff-refine-hunk does not work if I don't move the cursor to the good lines

texts:
In magit, it looks like that if I want to have a diff that highlight changing words, I can either press D t when I'm in the diff, or put in my .emacs

(custom-set-variables '(magit-diff-refine-hunk all))

However, it turns out that the changing words are highlighted only if I move the buffer cursor near to the line that changed. So for example if I have two changes in the file, then I need to move my cursor to the diff of the second part of the file to see the changes.

Can I set it up so that the refine diff is displayed across all the buffer ?

Thank you!


texts: How to modify content of org-mode document using org-element API?

texts:
Let's say I have an org-mode file at ~/myorg.org, looking like this:

* TODO My TODO list
** TODO Play games
** TODO Build a boat
** DONE Do something else

Now I want to modify this document using org-element. Let's say I want to change all TODO items to DONE. I thought something like this would work:

(with-current-buffer (find-file-noselect "~/myorg.org")
  (org-element-map (org-element-parse-buffer) 'headline
    (lambda (h)
      (org-element-put-property h :todo-keyword "DONE")))
  (save-buffer))

The structure returned from org-element-map seems fine, but the code doesn't modify the file. Do I have to replace the whole buffer text using org-element-interpret-data, or is there some other way?


texts:
When working on huge files, it seems that when hide-show collapses a large multi-line block, linum still creates hidden overlays for every line in the hidden block leading to unresponsive emacs. Is there a way to fix linum?

To reproduce: Create a new file, enable c-mode, hs-minor-mode and linum-mode,
create a huge block by typing: { C-u 10000 RET }
then execute hs-hide-all and watch Emacs become unresponsive.


texts: What is the mode or the command to selectively display selected region?

texts: There seems to be a command to display only the text in the selected region, leaving the rest of the text hidden. What is the command?


texts: Rename file from space to underscore in dired just the filename. Xah function for this also renames all parent directories

texts:
I found this function by xah to do this but it also looks at the parent directories. Ideally, this would just look at the filename not including the parent name or parent directories. Something along the lines of this regex:
^\\(.+\\)*(.+)\.(.+)$
where it would just take group \2 for replacing the spaces with hyphens instead of the whole path.

(defun xah-dired-rename-space-to-underscore ()
  "In dired, rename current or marked files by replacing space to underscore _.
If not in `dired', do nothing.
URL `http://ergoemacs.org/emacs/elisp_dired_rename_space_to_underscore.html'
Version 2017-01-02"
  (interactive)
  (require 'dired-aux)
  (if (equal major-mode 'dired-mode)
      (progn
        (mapc (lambda (x)
                (when (string-match " " x )
                  (dired-rename-file x (replace-regexp-in-string " " "_" x) nil)))
              (dired-get-marked-files ))
        (revert-buffer))
    (user-error "Not in dired.")))


texts: Evaluating the Chez Scheme code with C-x C-e

texts:
I've just installed Chez Scheme and combined it with the Geiser package using this tutorial M-x run-chez runs quite fine but C-x C-e causes the Emacs Lisp rather than Chez Scheme evaluate the code.

I've read through the Geiser cheat sheet but the key combinations listed there didn't seem to work.

What sould I do to evaluate the Chez Scheme code with C-x C-e ? Thanks.


texts: Tramp+bookmark crash when setting a different tramp-persistency-file-name file location

texts:
I have set tramp-persistency-file-name to a custom location since I want all the files generated by emacs stored in a specific location.

(setq files-dir "~/src/emacs.d/vendor/files/")
(setq custom-file (concat files-dir "custom.el")
      tramp-persistency-file-name (concat files-dir "tramp")
      host-file (concat hosts-dir (replace-regexp-in-string "[^A-Za-z0-9_-]" "-" (downcase (car (split-string (system-name) "\\.")))) ".el")
      version-file (concat versions-dir (number-to-string emacs-major-version) ".el"))

I do have some bookmarks set to some remote locations, that are supposed to use tramp to reach some remote files.

So, the "first time" I use it, it works. I can reach my /scp:host:/path remote path and open some files.

Then, Tramp generates the history file in the right location I've set (~/src/emacs.d/vendor/files/tramp).

But the next time, I want to open such a location, it crashes and generates this backtrace:

Debugger entered--Lisp error: (invalid-function (["scp" nil "my-host" nil nil] ("locale" "LC_ALL=en_US.utf8") ("uname" "Linux 3.2.0-4-amd64") ("test" "test") ("remote-path" ("/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin")) ("remote-shell" "/bin/sh") ("stat" "\\stat") ("file-exists" "test -e") ("id" "/usr/bin/id") ("gid-string" "my-user") ("ls" "/bin/ls --color=never") ("ls-dired" t) ("gid-integer" 1016) ("perl-file-spec" t) ("perl-cwd-realpath" t) ("perl" "\\perl") ("readlink" "\\readlink")))
  ((["scp" nil "my-host" nil nil] ("locale" "LC_ALL=en_US.utf8") ("uname" "Linux 3.2.0-4-amd64") ("test" "test") ("remote-path" ("/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin")) ("remote-shell" "/bin/sh") ("stat" "\\stat") ("file-exists" "test -e") ("id" "/usr/bin/id") ("gid-string" "my-user") ("ls" "/bin/ls --color=never") ("ls-dired" t) ("gid-integer" 1016) ("perl-file-spec" t) ("perl-cwd-realpath" t) ("perl" "\\perl") ("readlink" "\\readlink")))
  eval-buffer(#<buffer  *load*> nil "/Users/my-user/src/emacs.d/vendor/files/tramp" nil t)  ; Reading at buffer position 702
  load-with-code-conversion("/Users/my-user/src/emacs.d/vendor/files/tramp" "/Users/my-user/src/emacs.d/vendor/files/tramp" nil t)
  load("tramp" nil t)
  (let ((default-directory (or (symbol-value (quote temporary-file-directory)) "/"))) (load "tramp" nil t))
  tramp-autoload-file-name-handler(expand-file-name "/scp:my-host:/home/my-user/my/path" nil)
  file-readable-p("/scp:my-host:/home/my-user/my/path")
  bookmark-default-handler(("MyBookmark" (filename . "/scp:my-host:/home/my-user/my/path")))
  byte-code("\301!\206�\302\303!!\207" [bookmark-name-or-record bookmark-get-handler bookmark-default-handler bookmark-get-bookmark] 3)
  bookmark-handle-bookmark("MyBookmark")
  bookmark--jump-via("MyBookmark" switch-to-buffer)
  bookmark-jump("MyBookmark")
  bookmark-bmenu-this-window()
  call-interactively(bookmark-bmenu-this-window nil nil)
  command-execute(bookmark-bmenu-this-window)

Note: if I comment the line setq tramp-persistency-file-name blabla, it solves the problem but the file is located in my emacs.d directory (which I do not want).

Do you have any idea what's going wrong ?
Should I report a bug or am I the bug ?

EDIT: as requested here is the tramp file generated after the first use of the feature

;; -*- emacs-lisp -*- <15/12/23 10:35:22 ~/src/emacs.d/vendor/files/tramp>
;; Tramp connection history.  Don't change this file.
;; You can delete it, forcing Tramp to reapply the checks.

((["scp" nil "my-host" nil nil]
  ("locale" "LC_ALL=en_US.utf8")
  ("uname" "Linux 3.2.0-4-amd64")
  ("test" "test")
  ("remote-path"
   ("/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin"))
  ("remote-shell" "/bin/sh")
  ("stat" "\\stat")
  ("file-exists" "test -e")
  ("id" "/usr/bin/id")
  ("gid-string" "my-user")
  ("ls" "/bin/ls --color=never")
  ("ls-dired" t)
  ("gid-integer" 1016)
  ("readlink" "\\readlink")
  ("perl-file-spec" t)
  ("perl-cwd-realpath" t)
  ("perl" "\\perl")))


texts: Emacs hung with Error running timer 'blink-cursor-start'

texts:
I just installed a fresh Ubuntu 17.10 on a Dell XPS 15, and then installed Emacs from the repos with apt-get in the normal way.

The moment I start Emacs, I get the error message

Error running timer 'blink-cursor-start': (wrong-type-argument listp 0.5)

It then refuses all keyboard input; for example C-x d gets the error message Wrong type argument: listp 10

Is there a way to disable (from outside Emacs) whatever it is that calls blink-cursor-start so that I can at least try using Emacs to find and fix the problem? I have not installed my .emacs file yet, so this is raw behaviour as-installed.

Has anyone seen this behaviour before? Or know what the problem might be?

[Edit] I managed to run Emacs without the suggested -Q just enough to open the messages buffer with the mouse and grab the contents. Then quit and run again with -Q and paste the message contents into a file to save it. This is what it says:

Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50asymptote.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
Loading cjk-enc...done
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done
Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
setq: Wrong type argument: listp, 10
Error running timer ‘blink-cursor-start’: (wrong-type-argument listp 0.5) [2 times]
setq: Wrong type argument: listp, 0.7
Error running timer ‘blink-cursor-start’: (wrong-type-argument listp 0.5) [5 times]
Mark set
Error running timer ‘blink-cursor-start’: (wrong-type-argument listp 0.5)
setq: Wrong type argument: listp, 0.7 [2 times]
Error running timer ‘blink-cursor-start’: (wrong-type-argument listp 0.5)
setq: Wrong type argument: listp, 0.7
Error running timer ‘blink-cursor-start’: (wrong-type-argument listp 0.5) [4 times]

Anyone know where blink-cursor-start is called?


texts: Change the behavior of Org-mode auto expand relative path in link

texts:
For example:

- modes/mu4e/mu4e.org
      `-data/images/kk.png

in file mu4e.org, when insert link with [C-c C-l], the link
file:../data/images/kk.png will auto expand to
file:~/Org/Emacs/modes/data/images/kk.png.


texts: How to exclude bookmarks from ido virtual buffers?

texts:
I just put (setq ido-use-virtual-buffers t) in my init file. It seems ido virtual buffers includes my bookmarks after I use bookmark-jump.

How could I make ido virtual buffers only includes  my recent files?


texts:
I'd like to be able to edit equations as it is done in Lyx, that is, for example, being able to change a sub- or superscript without losing the rendering of the equation (even if it's a mid-low quality render as in Lyx). In general, being able to edit any equation directly in the rendering.

I've been digging around auctex manuals, but I don't see how can this be done, and I think there must be a way, as I can read the following from the auctex manual:

  Current uses of the package include the preview-latex package for WYSIWYG functionality in the AUCTeX editing environment, generation of previews in LyX, as part of the operation of the pst-pdf package, the tbook XML system and some other tools.

Thanks!


texts: Add custom parenthesis before and after selection

texts:
I use emacs to write latex and I need to enclose a lot of small expression in braces ( \{ and \} for latex) I would like to select the text to enclose and have some command that would add { before the selected text and } after. Is it possible with a simple command?
Thank you.

EDIT: Corrected { } to \{ \}


texts: Issues setting up Java code completion in CEDET. Cannot find semantic/db-javap

texts:
The line below is in my init file:

(require 'semantic/db-javap)

it is causing the following error message:

Debugger entered--Lisp error: (file-error "Cannot open load file" "semantic/db-javap")
  require(semantic/db-javap)
  eval((require (quote semantic/db-javap)) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

There are other semantic lines in my init file too, but this is the only one throwing an error.

It appears that CEDET comes installed by default, so why is this the only file missing? And what can I do to fix it?

Other relevant lines:

(global-ede-mode 1) ; Enable the Project management system
(require 'semantic/sb)
(require 'semantic/bovine/gcc)
(require 'semantic/db-javap)
(require 'semantic/ia)
(add-to-list 'semantic-default-submodes
         '(global-semantic-idle-local-symbol-highlight-mode
          global-semantic-idle-scheduler-mode
          global-semantic-idle-completions-mode))
(semantic-mode 1)

Emacs version 24.3.1


texts: How to check with regular expressions or another way if some package is used in a LaTeX document?

texts:
How to check if a specific package is used by a LaTeX document.
For example in the below document (intentionally written in an ugly but technically correct format), the packages fontenc, inputenc, csquotes,
babel, libertine, amsmath, biblatex, filecontents, tikz are used but
lettrine, cleveref, tocloft are not used (because they are in a comment area).

    \documentclass[ngerman]{article}
    \usepackage[T1]{fontenc,
    %babel,
    }
    %\usepackage{cleveref}
    \usepackage
[utf8
]
{inputenc}
    \usepackage{babel, csquotes

    tikz,
               % lettrine
    amsmath,libertine
    }

    \usepackage[backend=biber, style=authortitle]{biblatex}
    \usepackage
    {
    filecontents,

    %tocloft}
    }

    \begin{document}

    \end{document}


texts:
Q: how do I get only the duplicate elements in a list?

delete-dups (and cl-delete-duplicates) deletes all duplicate
elements from a list:

(delete-dups '(a b c c d d))            ; => '(a b c d)

I want the reverse: is there a function that returns only the
duplicates in a list?

(mystery-function '(a b c c d d))       ; => '(c d)


texts: Problem with org-insert-link and yas-expand

texts:
I have a problem when I want to yas-expand a link in Org-mode and it has a dash (-) in the text (url and description). Then the snippet break and exits. If I do the same in fundamental-mode it works.

Example

Typing text in fundamental and Org-mode. In fundamental mode:

"jira<tab>abc-123" ->
[[https://jira.example.com/browse/ABC-123][ABC-123]]

In Org-mode:

"jira<tab>abc-123" ->
[[https://jira.example.com/browse/ABC-][ABC-]]123

In fundamental-mode I can tab to the last position. But in Org-mode it exits before that.

Snippet

The snippet looks like this:

# -*- mode: snippet -*-
# name: jira
# key: jira
# --
[[https://jira.example.com/browse/${1:$$(upcase yas-text)}][$1]]$0

Emacs Config

I have this config:

(use-package yasnippet
  :ensure t
  :config (yas-global-mode))

Full source for this (my emacs testing area): Source

If I change the snippet and remove the last "]", it works again but without becoming a link.

From: [[${1:$$(upcase yas-text)}][$1]]$0
To:   [[${1:$$(upcase yas-text)}][$1]$0

So it has something todo with org-insert-link but I cannot find out if this belongs to yas or org. Maybe there is a workaround for this. Any ideas how to troubleshoot or fix this?

Versions

yasnippet-20181015.1212
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/27.0.50/lisp/org/)
GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-03-04


texts: How to disable icicles integration with helm?

texts:
Long time ago I updated Helm and it replaced normal Icicles behaviour for choosing files.

I had icicles bound to C-x C-f:

C-x C-f runs the command icicle-file, which is an interactive Lisp
function in `icicles-cmd1.el'

But after the Helm update Emacs began to open helm-find-file over-designed dialog instead of normal behaviour. The user experienced dropped hereafter.

Today my patience has run out and I determined to break Helm and Icicles integration. Could you advise me from which side should I begin my quest?


texts:
I very much {like, use} the kmacro-*-counter family of commands. However I sometimes find myself needing to generate alphabetic sequences (e.g., A, B, C, ...) instead of integer sequences (e.g., 1, 2, 3 ...). I can sorta see how to do this in 2 passes using query-replace-regexp and something like make-string, but that means 1st generating the integer sequence and then replacing it.

Is there an easier way? Particularly, is there some {command, function, package} that will support a usecase like

M-x foo-set-alpha-counter A
(loop) M-x foo-insert-counter

?


texts:
I asked this question originally on StackOverflow. I use M-x compile within Emacs to compile my C code which then initiates make -k and allows me to compile the code. I wish to use Clang (or conceivably GCC 4.8 after I install it) as the default compiler. I have cc aliased to clang -Wall -Werror -std=c99 -ggdb -O0 and while this invokes Clang from the command line outside of Emacs, invoking M-x compile from within Emacs still seems to alias cc to GCC version 4.7 which is what I have installed. I wish to tap into the richer and more understandable error and warning messages provided by Clang (and GCC 4.8) but do not wish to create a separate makefile for every short student-level program I am writing, since I am currently going through K&R including solving the exercises.

How do I convince Emacs that M-x compile and make -k should invoke Clang (or GCC 4.8) instead of the older version of GCC?


texts:
I have added in my init something like:

(defun today-CA ()
  (interactive)
  (eww "https://www.google.com"))

This opens eww through the today-CA function. I want to open it in readabe form, i.e. as if eww-readable had been invoked in the eww buffer. How to do that? This doesn't work:

(defun today-CA ()
  (interactive)
  (eww "https://www.google.com")
  (eww-readable))


texts: "Symbol’s value as variable is void: org-priority-highest" using org-agenda

texts:
While I'm trying to access any of the org-agenda options or commands! I always get this error Symbol’s value as variable is void: org-priority-highest
and the list shows nothing even though I've set org-agenda-files correctly


texts: Stop at beginning of a word on `forward-word`

texts:
I often use multiple invocations of forward-word followed by a single backward-word to move point to the beginning of a word on a line.  I guess I never got used to the way forward-word differs from vim's w and even after years of using Emacs I cannot get used to the difference.

Is there a function I could use instead of forward-word that doesn't jump over words but stops at the beginning of a word as well?  Are there other strategies to move to the beginning of a word when moving point forward that don't involve repeatedly executing forward-char?


texts: Is it possible to use emacsclient remotely?

texts:
I'd like to use emacsclient on my laptop to connect to an emacs server on my desktop.

I think I know that the emacs server process listens to a unix socket in "/tmp/emacs${UID}".

So I need to make a connection between a unix socket in laptop:/tmp/emacs${UID}/socat to desktop:/tmp/emacs${UID}/server.

I can make a socket locally with socat.  I have tested:

socat -v UNIX-LISTEN:/tmp/emacs${UID}/socat UNIX-CONNECT/tmp/emacs${UID}/server
emacsclient -nw -s socat .

That works.

So now I need to connect socat to server on the remote host...

desktop:
socat -v TCP-LISTEN:7777 UNIX-CONNECT:/tmp/emacs${UID}/server
laptop:
socat -v UNIX-LISTEN:/tmp/emacs${UID}/socat TCP-CONNECT:127.0.0.1:9999
ssh -L9999:127.0.0.1:7777 desktop
emacsclient -nw -s socat .

I can successfully route traffic over this setup.  I know this because my home directory is different on my laptop, and the socat on the desktop is dumping out laptop-home-directory-related paths.

However, the emacsclient process on my laptop doesn't draw a frame.

Is there a way to make this work?

Edit: xuchunyang writes:

By the way, we don't need emacsclient to use the Emacs server, echo '-
eval emacs-version' | nc -U /path/to/emacs/socket works as well.

I can confirm that connecting to the socket on the laptop works:

laptop $ echo '-eval emacs-version' | nc -U /tmp/emacs248200/socat
-emacs-pid 184752
-print "26.3"
$


texts:
my emacs shell mode screen shot ...

Normal shell looks like this...

I have .emacs file empty..

emacs version 24.5.1

I already tried this
https://stackoverflow.com/questions/20663005/why-does-shell-mode-display-some-rubbish-code

[I copy the code provided in solution of above question in my .emacs file but its not working for me...]


texts: How to start in daemon mode and suppress interactive dialogs?

texts:
I love to start emacs in daemon mode with my first login and then have the same emacs process for all subsequent logins, be it graphical, on physical console or from the network via ssh.

But there is a problem with this, when using a session to save the last open files and some of this files are encrypted (e.g. with gpg) and ask for the decryption key on load. Then the application is frozen and waits for an input from a disconnected stdin.

How can I defer the question to the first time interactively changing to the buffer?

Or, how can I exclude the encrypted files from the session?

And maybe there is just another solution.


texts:
I was looking through my .emacs.el file and saw that Customize has put the following in it:

 '(org-mode-hook
   (quote
    (#[0 "\300\301\302\303\304$\207"
     [add-hook change-major-mode-hook org-show-block-all append local]
     5]
     #[0 "\300\301\302\303\304$\207"
     [add-hook change-major-mode-hook org-babel-show-result-all append local]
     5]
     org-babel-result-hide-spec org-babel-hide-all-hashes org-bullets-mode org-sticky-header-mode org-ac org-autolist-mode)))

What do the first two lines between (quote and org-babel-result-hide-spec... do?


texts: Open a frame for emacs instance via terminal?

texts:
Say I have emacs open on one screen and on another I'm working in terminal.

I see a file I want to open in emacs. Is there a quick way I could do something like emacs myfile and have a new frame, but same emacs instance pop up?

Or maybe this is the default behaviour(?), since it's hard to distinguish between a new frame and a second instance of emacs.


texts: Emacs' default `expand-abbrev` does not work

texts:
I try to use emacs -Q and then input RET RET dd in *scratch* buffer and then M-x add-mode-abbrev,
then after the prompting message Mode abbrev for "dd":, I input abcdefg RET.

So I defined an mode specific abbrev, but when I try to expand-abbrev when putting point after the previously input dd, nothing happened, even no warning messages.

My Emacs version is "GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0)
 of 2016-10-03".

Did I use expand-abbrev in a wrong way? Or does expand-abbrev of this version break?

Thanks!


texts: Why does flycheck behaviour not depend only on flake8 output and exit code?

texts:
I have a flake8 wrapper script: a small program that execs flake8 (in order to pick an appropriate version of flake8 for whichever project I'm working on).  flycheck is using that wrapper script (I'm sure of that because I can break syntax checking in emacs by editing the script).

I have verified that if I change the source code of the wrapper script in a certain way, such as to leave its stdout, stderr and exit code unchanged, flycheck's behaviour nevertheless changes!

In particular it seems that with one source code text for my wrapper script, flycheck shows both errors (red squiggly line under offending lines) and warnings (yellow squiggly line) -- and with the other source code text, it displays only warnings.

It seems perhaps emacs is actually looking at the text of the wrapper script itself in order to guess something?

Perhaps even more oddly, I've reproduced the same issue using both a wrapper script implemented in python, and one implemented in sh -- so the source code in each case is rather different!

This is a pretty crazy issue, anybody have any guesses, or hints on start debugging flycheck?

All help appreciated!


texts: Org-mode export gets weird symbols at the end of each line while exporting to HTML

texts:
I got some source blocks in my org document like this one:

#+BEGIN_SRC ipython
print("Hola")
#+END_SRC

When the org file is exported to html (and only to html) I got weird symbols at the end of each line:

print("Hola") 

Any ideas why this is happening?


texts: How would I create smarter HTTP links in org mode?

texts:
I have lots of links that look like:
https://domain.com/en/res/main/r1/sm-e/spec/1/1#q=1-1-1

I want to be able to enter a string like:
A-1-1

and be able to create a correct link like:
[[https://domain.com/en/res/main/r1/sm-e/spec/1/1#q=1-1-1][A-1-1]]

In the past, I was able to find help for links to pdf documents. But this is more complex, but I would love to hear your suggestions.
Can I have a bonus answer?
How do I pass multiple parameters to my abbreviations? Can the following be a clue? where I can find examples?
(org-link-set-parameter "type" :complete #'some-completion-function)


texts: I know that C-u sends the prefix 4. Is there any way to make C-u <key> a special case of a command, while still allowing C-u 4 <key>?


texts: Interactively matching beginning of region

texts:
Short version: If i bound the scope of a search/replace to a region in the buffer (via the second/third optional argument of search-forward and its derivates), how can i match the beginning of that region?

Longer version: Say, i have a test.txt which contains only

xxx yyy xxx xxx yyy xxx xxx yyy xxx xxx yyy xxx xxx yyy xxx
xxx yyy xxx xxx yyy xxx xxx yyy xxx xxx yyy xxx xxx yyy xxx
xxx yyy xxx xxx yyy xxx xxx yyy xxx xxx yyy xxx xxx yyy xxx

Now, I mark any part and like to run M-x query-replace-regexp to replace the first three characters of the marked region. How can i achieve this with a regular expression? A naïve try would be to use

(defun test-1 (b e)
  (interactive "r")
  (query-replace-regexp "^..." "zzz" nil b e)
 )

but ^ matches only bol (and so does \`  ), not the beginning of my region. In extension, i need a similar construction in a larger script that could be simplified to the following minimal example:

(defun test-2 ()
  (interactive)
  (while (search-forward "xxx xxx" nil t)
    (let ((beg (match-beginning 0))
          (end (match-end 0)))
     (query-replace-regexp "^xxx" "zzz" nil beg end)
     (goto-char (match-end 0)))))

Is there a way to match the beginning of any substring within a regionally bounded regular search?

I am aware that you could avoid the problem by working with narrow-to-region and thus make the beginning of the region the sub-buffer's bol but i'd like to avoid this for the sake of context when I replace stuff in my documents.


texts: How to pass newline ("\n") string to noweb >

texts:
Trying to pass multiline argument to Org code block. If make direct call of block then it's Ok.
But when call it through noweb ref then Error raised

#+NAME: pr
#+BEGIN_SRC elisp :results value :var n="a\nb\nc"
"%p" n
#+END_SRC

#+RESULTS: pr
: a
: b
: c

#+BEGIN_SRC elisp :noweb yes :results value
<<pr("a\nb\nc")>>
#+END_SRC

eval: Symbol’s value as variable is void: a

I need this to be able to use pr block with another noweb call already in SQL like this

insert into table
select @SPID, <<pr("1\n2\n3\n4")>>

proposing to get string executed in sqlcmd

select @SPID, 1
select @SPID, 2
select @SPID, 3
select @SPID, 4


texts: make-magit-popup-event: Symbol’s function definition is void: record [SOLVED]

texts:
I get the above message using the latest magit from melpa.  This occurs with

GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-12-20

on Ubuntu 16.04.

Any ideas?


texts:
Let's say I just did a commit with changes to two files. Now I would like to have just one of the files in that commit, and I would like to stash the other file. So, in essence, I would like to soft reset, unstage one of the files, recommit with the same message (or maybe change it). And after all that, I will have the second file not committed, and I can stash it, or stage it and commit it anew or whatever.

I used to do that in GitX easily, by just clicking the amend last commit checkbox. It would show the staged changes, the commit message etc, and I could just change the message, or stage more, unstage some, etc.

Is there an easy way to do that in magit?


texts:
Say I want to create and edit a new R file using emacs/ESS. I type emacs myfile.R at my shell prompt and an empty file opens. Hurray! I start typing my code:
library(da
at which point I am interrupted and prompted with,
R starting project directory? ~/Desktop/
I think I have two options: 1) Ctrl+g to ignore the prompt and keep on working or 2) specify a project directory. If I do the former, I will keep getting the same prompt until I specify a project directory. If I specify a project directory, an R console will automatically open. The problem is that I don't want an R console: I just want to create and edit an R file using ESS so that I have syntax highlighting.
Q: Is there a way to prevent the R console from opening?


texts: run emacs function in the shell with parameter

texts:
Since there is parameter I need to use, so I will not use single quote as the question's answer

First, I try

emacsclient -q --eval (progn (find-file "ORG/${UN}.org") (org-latex-export-to-pdf))

  zsh: bad pattern: (progn (find-file ORG/Austin.org)
  (org-latex-export-to-pdf))

Then,

emacsclient -q --eval "(progn (find-file "ORG/${UN}.org") (org-latex-export-to-pdf))"

I get the error again

  ERROR: Symbol’s value as variable is void: ORG/Austin\.org

The question is how to give the parameters.

Update

I still get error after backslash the period

emacsclient -q --eval "(progn (find-file "ORG/${UN}\.org") (org-latex-export-to-pdf))"

  ERROR: Symbol’s value as variable is void: ORG/Austin\.org


texts: Elpy shell-send-region to a particular named Python buffer

texts:
I often open up interactive python sessions particular to the project that I'm working on, and will use M-x rename-buffer to title them *Python[Project1]*, Python[Project2]`, etc.
I would like to configure my C-c C-c to send to the correct project's buffer.
I know I can use python-shell-buffer-name . "Python[Project1]") to set a buffer's name, but what variable do I set to ensure that C-c C-c and similar will respect this, versus sending to *Python* or to the last used buffer, which may be *Python[project_wrong]* ?
I've looked at the following:

show output from python-shell-send-region


texts: Remember expansion of headlines in org-mode?

texts:
In my org file, I have a lot of headlines that I'd like to keep folded most of the time - and some that I want expanded, but the state of each expanded headline is lost when I close emacs.

Is there a way to restore the state upon re-opening the file?

PS: I'm not looking for the default expansion state as in Keep the headlines expanded in Org-Mode, nor I want to set the default visibility of each headline manually through properties - I want to remember the state of the whole file, heterogenous as it may be.


texts: How can one quickly remove ancillary snippets of code?

texts:
How can one quickly remove ancillary snippets of code in Python scripts under Emacs?

For example, for debugging purposes, I often add some print statements to print out the values of some variables. When I finish coding, I would like to remove the print statements in a quicker way than manually selecting and deleting one by one.

Thanks.


texts: How to delete all list elements matching a regexp?

texts:
Given a list:

(setq mylist '("a1" "a2" "b1" "b2"))

How to delete all elements that match ^a?

What I want is "a1" and "a2" deleted, only left "b1" and "b2" in the list.


texts: Setting :stdin with #+call in org-mode shell code block

texts:
I've got the following code:

#+NAME: example-block1
#+BEGIN_EXAMPLE
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
#+END_EXAMPLE

#+NAME: example-block2
#+BEGIN_EXAMPLE
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
#+END_EXAMPLE

#+NAME: my-shell-block
#+BEGIN_SRC sh :stdin example-block2
cat
#+END_SRC

#+CALL: my-shell-block()

Calling the "my-shell-block" with a hardcoded :stdin reference is no problem.

But now I want to set the :stdin dynamically in another "CALL":

#+CALL: my-shell-block(:stdin=example-block1)

This obviously does not work. Is there a way to dynamically change the ":stdin" of a shell code block?


texts: File-missing "No such file or directory" "c:/emacs-26.1-x86_64/bin/%HOMEDRIVE%%HOMEPATH%/"

texts:
I'm launching Emacs using runemacs on Windows 7, from the emacs directory (C:\emacs-26.1-x86_64\bin), using runemacs --debug-init.

I get the following error text:

Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "c:/emacs-26.1-x86_64/bin/%HOMEDRIVE%%HOMEPATH%/")
  directory-files("~" nil "^\\.emacs\\(\\.elc?\\)?$")
  #f(compiled-function () #<bytecode 0x1000be22d>)()
  command-line()
  normal-top-level()

The HOMEDRIVE is set to "P:".
The HOMEPATH is set to "\".

I don't understand why the HOMEDRIVE and HOMEPATH would be concatenated to the CWD.

Where is this coming from?

Here is my .emacs file:

(set-default 'truncate-lines t)
(load-file "C:/emacs-26.1-x86_64/share/emacs/26.1/lisp/cedet/cedet.el")
(setq-default cursor-type 'bar)
(set-cursor-color "#ff0000")
(global-ede-mode 1)
(semantic-mode 1)
;;(global-srecode-minor-mode 1)
(require 'doxymacs)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(blink-cursor-mode nil)
 '(c-basic-offset 4)
 '(c-default-style
   (quote
    ((c-mode . "linux")
     (c++-mode . "linux")
     (java-mode . "java")
     (awk-mode . "awk")
     (other . "gnu"))))
 '(c-offsets-alist
   (quote
    ((topmost-intro . 0)
     (comment-intro . 0)
     (indent-tabs-mode nil)
     (c-toggle-auto-state -1)
     (c-toggle-auto-hungry-state 1)
     (substatement-open . 0)
     (case-label . 4)
     (block-open . 0)
     (member-init-intro . 2)
     (knr-argdecl-intro . -))))
 '(c-tab-always-indent nil)
 '(column-number-mode t)
 '(cursor-type (quote bar))
 '(display-line-numbers t)
 '(doxymacs-command-character "/*!")
 '(doxymacs-doxygen-dirs
   (quote
    (("c:/menuplan/src/ingredient/" "c:/menuplan/docs/doxygen_tags.txt" "file:///menuplan/docs/code/html/index.html"))))
 '(doxymacs-doxygen-style "C++")
 '(inhibit-startup-screen t)
 '(tab-width 4))

;; Show filename in title bar
(setq frame-title-format "%b - Emacs")

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(defun my-doxymacs-font-lock-hook ()
  (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
      (doxymacs-font-lock)))
(add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)

How do I fix this?

(Note: Emacs suggest I restart with the "--debug-init", after I tried to open a CPP file using Windows File Explorer.  I have the CPP extension associated with runemacs.)

Edit 1:

Original error text, when running from a short cut to `runemacs`:
Error (initialization): User tmatthews has no home directory
Warning (initialization): An error occurred while loading ‘nil’:

File is missing: Opening directory, No such file or directory, c:/emacs-26.1-x86_64/bin/%HOMEDRIVE%%HOMEPATH%/

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.


texts: Editing Fortran90 in a fixed format mode

texts:
I am currently writing a user-script for a simulation software, and the program requires the use of Fortran90 syntax in 132-columns fixed format.

Emacs has two Fortran modes that I know of, fortran-mode and f90-mode. Fixed formmat is not supported in f90-mode so I am stuck using fortran-mode. The number of columns can be fixed, but the syntax highlighting is not correct.

Keywords such as use, contains, intent, dimension, end subroutine <name> are not recognized.
Variables aren't being highlighted after the :: operator.

While these are simple inconveniences and they do not affect the programming experience much, Emacs is all about convenience. So my question is:

Is there a simple way to achieve the f90-modesyntax highlighting in fortran-mode?


texts: Modify value of a variable by applying a function to it?

texts:
Suppose one of the customizable variables in a package is var, and its default value is a list, list. I understand I can change the value of var to mylist using
(setq var mylist)

in my init.el.
Suppose though that I have a function fun and I want the value of var to be the result of applying fun to list. Can I simply do this?
(setq var (fun var))

I've done it and it seems to work as intended, but I want to make sure this is a good idea.

EDIT: My question was not very clear, so let me clarify the sort of thing I was worried about (this may be redundant in light of my comment to this answer by Drew. Suppose I add
(setq var (fun var))

to my init.el. How do I ensure that the default value of var has already been set when that line gets evaluated? Should I put this inside a  with-eval-after-load? And how do I ensure that M-x load-file ~/.emacs.d/init.el won't result in var being set to the value of (fun (fun var))? Should I instead add the above line to something like emacs-startup-hook or after-init-hook?
I'm currently using a line in my init.el like the above for setting a variable to a value as a function of its default value. I'm relying on use-package, and in order to ensure that the default value of the variable had been set I had to put that line in the :config section of the relevant package, rather than in the :custom section (without setq). Also, the function I am currently using has the nice feature that (fun (fun var)) yields the same output as (fun var). So I have managed to get around both of my concerns.
Still, this seemed like an opportunity to try to understand how to do what I'm trying to do even if I'm not using use-package and if I have a function that's not idempotent.


texts: What is the recommended way to generalize a defcustom from atom to sequence?

texts:
In an Emacs package I have a defcustom, say custom-string, that is defined as an atom of type string like so:

(defcustom custom-string "foo"
  "A customizable string."
  :type 'string)

I need to generalize the variable so that it can be a sequence of strings, but if the user has already chosen a single string it will be fine to continue using that string as before.  (For example, the variable could be a list of paths to search.  One path is sufficient, but some users may want to use multiple paths.)  I'd like to update the package in a way that doesn't break existing configurations.  I see two ways forward, but I don't know which is preferable or if there is some other standard approach for this:

Deprecate custom-string with make-obsolete-variable and and create a new variable called custom-strings which is of type (repeat string).  In this case, if the user has defined the atomic variable, then it can be detected and used to initialize the list variable.  This approach looks like this:

(make-obsolete-variable 'custom-string 'custom-strings "2017-11-10")

(defcustom custom-strings
  (if (boundp 'custom-string)
      (list custom-string)
    '("first" "second" "third"))
  "Customizable list of strings."
  :type '(repeat string))

The benefits of this approach are that the user doesn't have to change his or her configuration and the new variable name is plural, an indication that it is a sequence.
Keep the variable name the same but change the defcustom type to (repeat string).  In the code where the variable is used, add a conditional to check if it is a string or a list.

(if (stringp custom-string)
    ... ; handle single string
  ...) ; handle list case

This approach also has the benefit of allowing the user init file to remain unchanged, and furthermore it leaves the variable name the same so that documentation, tutorials, etc. don't need to be updated.  But it may be confusing that it is a list with a singular variable name (i.e., -string not -strings).  I also worry that this might break existing configurations for users who use the customize interface, where it has been stored as a string.  (I don't use customize, so I'm not sure how this is handled.)

I have used the first approach before in markdown-mode, when I changed markdown-css-path to markdown-css-paths so that users could link multiple stylesheets.  However, this time I have several variables to change at once and I'd like this to be as unobtrusive as possible.  I haven't been able to find examples from other packages.  Which of these is the most "Emacs-like" way of proceeding?  Or is there another, better solution I haven't thought of?


texts: What kinds of whitespace are visualized in Whitespace mode?

texts:
According to the Emacs manual (section 14.16 Useless Whitespace):

  The kinds of whitespace visualized [in whitespace mode -- Evan] are determined by the list variable whitespace-style.

However, when I execute C-h v whitespace-style RET, no match is found.

How can I view the list of whitespace visualized in whitespace mode?


texts: How to limit the up-directory search for file info

texts: As Emacs opens a file it does all sorts of useful things including walking up the directory tree for more information (repos etc).  I'm in a situation where I need to curtail that climb.  Is there a mechanism for this or other work around?


texts: Run shell commands in emacs by something similar to M-x ...?

texts:
I have a program which can run as a command in bash.

Can I run the program in emacs, in some way similar to run emacs' command (i.e.M-x , e.g. M-x occur), instead of first explicitly running a shell in a buffer of emacs and then running the program in the shell?

Thanks!


texts: How can I only show different lines in ediff?

texts:
This seems like such a basic feature to have in a diff mode, but I can't find anything in the documentation.

If I have two 1000 line files, and only one line is different, I want to be able to hide the other 999 lines. Something like diff -y --suppress-common-lines or diff -C 0 (zero lines of context).

And I'd really like to be able to toggle such a feature.


texts:
What should I type in replace-regexp command to change the first list below into the second? I'd like to repeat each number at the beginning of line. To achieve that, I assume that I'll have to refer to each regexp match when I type what I'd like to replace each of them with, but how can I do that?

* apple
12
* banana
5
* grape
5
* watermelon
3

* apple
12 12
* banana
5 5
* grape
5 5
* watermelon
3 3


texts: Customize: highlight-symbol-colors added only delta

texts:
Windows 10, Emacs 25.1

By default package highlight-symbol has 9 colors.
So I add new color, snow, to option highlight-symbol-colors:

Screenshot:

OK.

As a result Customize puts this in my init file:

(custom-set-variables

 '(highlight-symbol-colors
   (quote
    ("yellow" "DeepPink" "cyan" "MediumPurple1" "SpringGreen1" "DarkOrange" "HotPink1" "RoyalBlue1" "OliveDrab" "snow")))
 )

As you can see the variable highlight-symbol-colors contains all 10 colors, including "snow".

My question is:

How to make option highlight-symbol-colors contain ONLY the colors I add, and not also the colors that it has by default?

I want the result to be something like this:

(custom-set-variables
 '(highlight-symbol-colors
   (quote ("snow"))))

So as result I must use 10 colors.

Is this possible?


texts:
Given an org document where some headers are visible and others
not, and some content is visble and other content not, how can I
hide all content, but leave the headers that were visible before
visible and those that were invisible before invisible?  If
there is no straightforward way of doing it, could one write a
function to that effect?


texts:
I'm using emacs for perl scripting and for some unknown reason the syntax highlighting is inactivated when opening new or existing scripts.

I'm wondering if I press a key unknowingly that disactivates it.

Currently my only option is to close emacs and start a new session.

Is there a way to reactivate it?

Not sure which mode is providing the highlighting.

Thanks


texts: org-mode: automatically clock in to a task with idle-timer

texts:
I use most of the setup of http://doc.norang.ca/org-mode.html. Now I want to clock in to a task by default after startup. Reason/workflow is as follows: every morning I turn on my computer and Emacs starts automatically (via GNOME autostart). In the meantime I get a coffee. And when I'm back at my desk I forget to clock in.

I tried simply calling

(run-with-idle-timer 5 nil 'bh/clock-in-organization-task-as-default)

but it doesn't work and throws me an error:

byte-code: Before first headline at position 1 in buffer *scratch*

What am I doing wrong?


texts: how to include remote images in org-mode export to LaTeX?

texts:
When I paste the URL of an image into an org-mode file and then export it to HTML, the remote image URL gets turned into an img tag and displayed in my HTML file without the need for me to save the image locally.

For instance, if I have a file foo.org consisting solely of the text https://vetstreet-brightspot.s3.amazonaws.com/fa/19/73e1a8864e8a868b30d728f81431/most-popular-puppy-names-2016-thinkstockphotos-527135315.jpg, it will export to an HTML file with a viewable image.

I'd like to do the same thing with PDFs. How can I include remote images when exporting to PDF via LaTeX?


texts: Progress Percentage calculate Sub Percentages

texts:
* TODO Organize party [50%]
** TODO call people [33%]
   - [ ] Peter
   - [X] Sarah
   - [ ] Sam
** DONE order food
** TODO think about what music to play
** DONE talk to the neighbors

is there a way to tell org mode to include the 30% to the overall Organize party header?

2 items done = 50 %
2 items done and one item 33% done = 50% + (25% * 33%)


texts: Why does Emacs indent my Lisp LOOP construct weirdly?

texts:
I'm using Emacs and SLIME to edit Lisp code.

By default, Emacs indents my Lisp LOOP constructs like this:

(loop for x across dna1
   for y across dna2
   count (not (eql x y)))

But I expect it to line up subsequent lines with the first parameter:

(loop for x across dna1
      for y across dna2
      count (not (eql x y)))

This still works fine for other functions:

(+ 1
   2
   3)

Can someone explain to me why this is happening? Is it because LOOP is a macro? Is there a way to fix it? Should I fix it?


texts:
How do I get mu4e to handle xdg-open mailto:foo@bar?
I couldn't even find a function taking an address as an argument that will open a composition buffer.


texts: How to make undo-tree linear -- undo-tree-undo/redo

texts:
When running the command undo-tree-undo/redo successively, things are undone/redone based upon the current active branch.  Although the user receives a branch point message along the way, the previous branches are ignored unless a user manually selects a different branch.

I understand that I can open the visualizer and select a different branch, however, it would be very useful to just hold down the undo/redo key and watch everything happen in the exact opposite order.  Ideally, this should work irrespective of whether the visualizer buffer is open -- i.e., programmatically calculate the order from finish to start, and from start to finish.

Q:  This is essentially a feature request to extend undo-tree to permit linear successive undo/redo, irrespective of whether the visualizer buffer is open.  [New functions and alternative keyboard shortcuts for this new feature are certainly acceptable.]


texts: How can I automatically rename buffers created with `async-shell-command` to the shell command that was called?

texts: I am often opening exwm buffers by running async-shell-command but unfortunately these buffers always get named *EXWM*. It would be great if when I ran async-shell-command 'firefox the buffer that gets created would be named firefox.


texts: Super-s: How to express it? Is some escaping needed in the syntax?

texts:
This code binds "Super-c" to lambda:
(global-set-key (kbd "s-c")
      (lambda () (interactive) (jump-to-register 'q)))

How can I bind Super-s? They are both denoted as "s": (kbd "s-s"). I need to escape one of them somehow.
My Emacs version: GNU Emacs 26.3 (build 1, i586-slackware-linux-gnu, GTK+ Version 3.18.9) of 2019-08-29. Running on Linux Slackware 14.2.


texts:
Is it possible to tweak auto-completion of tag names to make it seem like if there were multiple levels of tags? For example:

* Movie A              :entertainment:movies:action:
* Movie B              :entertainment:movies:horror:
* Album X              :entertainment:music:
* Spatula              :to_buy:cooking:
* Album Y              :to_buy:music:

When setting a new tag on an item, if no tags are currently set, by pressing TAB I would be presented with two options: "entertainment" and "to_buy" (since they are the only two first-level tags). Suppose I select "entertainment" as the first tag, and that I want to add a second tag. I would press TAB again to see the options and I would only be presented with "movies" and "music", since they are the second-level tags of "entertainment".


texts: Disable left win key in Emacs for Windows

texts:
With AutoHotkey If I press the key Win alone, then nothing happens. That's true except with Emacs, because it opens the Windows menu.

Is there a way to prevent it?

Update:
In AHK I have exaclty LWin::Return, but if I press LWin in Emacs the Windows menu opens and checking the AHK Key History I can see

VK  SC  Type    Up/Dn   Elapsed Key     Window
------------------------------------------------------
5B  15B     d   9.19    LWin            emacs@ASPC419
5B  15B h   u   0.06    LWin
5B  15B a   d   0.00    LWin
5B  15B h   u   0.00    LWin


texts: I have binded Winum functions to SPC 0 - SPC 9. In which-key minibuffer I see each key by its own (10 labels), which occupies a lot of space. It would be great if I could group all winum keys labels into one label like "0..9". So I wonder there if is some way to do this.


texts: My emacs company mode won't work with python. I use doom emacs. I have company mode and ivy in my init.el. I have flycheck enabled in python

texts:
:completion
       company           ; the ultimate code completion backend
       ;;helm              ; the *other* search engine for love and life
       ;;ido               ; the other *other* search engine...
       (ivy +fonts +ivyposframe)               ; a search engine for love and life

I use Emacs version 27.1 and Doom version 2.0.9 and Python version 3.9.1. What do I do to get the completion popups working again.


texts:
I'd like terminal Emacs to observe the current value of cursor-style when the current terminal emulator supports commands to change the cursor.

For example: MinTTY is the default terminal emulator for Cygwin. According to this page, it supports changing cursor styles using the following escape sequences:

\e[1 q for a block cursor.
\e[5 q for a bar cursor.

Other terminal emulators that support these escapes include the VTE-based emulators (gnome-terminal and friends) and xterm and its derivatives.

Currently, hacks exist for evil-mode that attempt to simulate this support. Unfortunately, these break when the terminal doesn't support said escapes. Here's a question to see if that's fixable.

As far as I can tell, Emacs doesn't support changing the cursor natively. Is there any way we can support it without relying on a package like evil?


texts:
I have a bibtex file, and would like to have indentation as follows.

@book{moon70:trees,
       AUTHOR = {John W. Moon},
        TITLE = {Counting labelled trees},
         YEAR = 1970,
       SERIES = {Canadian Mathematical Monographs},
       NUMBER = 1,
    PUBLISHER = {Canadian Mathematical Congress}
}

I am thinking of creating a indent-bibtex-entry command,
but I am stuck in steps 4 and 5.

Save current position, jump to the previous ocurrence of the
regular expression ^[ \t]*@, then to the next { and then to the
next ,.
While next nonblank is not }
Capture the next field with the regular expression [ \t\n]*\([^ \t=]+\)=.
Replace by \n \1 = where the number of spaces must make the
total length of this expression equal to, say, 15.
Capture the entry's content (see caveats below), removing
line-breaks and spaces before and after.
Goto 2.
Restore cursor's position.

Caveats

The content of an entry is somewhat tex-aware.
The entries are text between quotes "like this"
or between matching braces {like this}.
However, you may have braces (as long as they're balanced)
inside, and escaped quotes as well {na\"ive {example}}.

Simplier, but also nice

If that is too difficult, an alternative is to define a command
indent-field, assuming that the line contains a single field.
The problem is similar to the previous step 4 (but here it is step 3).

Save current position, jump to the beginning of the line.
Capture the next field with the regular expression [ \t\n]*\([^ \t=]+\)=[ \t\n*]*.
Replace by \n \1 = where the number of spaces must make the
total length of this expression equal to, say, 15.
Restore cursor's position.

Any suggestions? I am still working on the code for the items I "know" how to do.
This is my first time with elisp.


texts: Preserve window arrangement for secondary windows

texts:
I often keep a "short" secondary window below my main window with an arrangement like so:

+---------+
|         |
|         |
|   top   |
|         |
|         |
|         |
+---------+
|         |
| bottom  |
|         |
+---------+

The bottom window typically contains, *compilation*, *grep*, *Shell*, *Help*, etc. I typically keep a 80%-20% top-bottom split, but I find myself having to maintain this manually. Whenever I open certain new mode types like Help they often grow the bottom window to a 50-50 split with top. Is there any way for me to preserve this arrangement even when invoking these alternative modes like Help or compilation?


texts: How not to remove other back-ends specific contents using org-org-export-to-org?

texts:
Using org-org-export-to-org:

#+ATTR_HTML: :style max-width:60%;
[[file:data/fool_f7dc.png]]

Is exported as:

[[file:data/fool_f7dc.png]]

Is there a way to keep the line #+ATTR_HTML: :style max-width:60%;?

Thx!

Edit:

Tried suggestion solution:

#+begin_export org
#+ATTR_HTML: :style max-width:60%;
[[file:data/fool_f7dc.png]]
#+end_export

But does not work since org-org-export-to-org returns:

#+BEGIN_export
[[file:data/fool_f7dc.png]]
#+END_export


texts:
I'm trying to use the built-in elisp debugger, invoked by debug, and read the source code at the same time. Unfortunately, whenever I continue execution, with either c or d, the debugger jumps around to a different window -- to the previous window configuration, or some other one that it seems to prefer. It also seems to scroll the source buffers I have open around. This makes it difficult to use.

Is there a way to get it to stop doing so? Has anyone else observed this behavior?


texts:
I'm in Windows 7 (32 bit) and I'm using Emacs 24.4 where I have, among other things, Org 8.2.

I'd like to open pdfs in Sumatra PDF after exporting *.org files to pdf via *.tex. So I read this other discussion, and I wrote in my .emacs config file the following code similar to what's written under the "Tricks" paragraph:

(eval-after-load "org" '(progn (setcdr (assoc "\\.pdf\\'" org-file-apps) "sumatra PDF %s")))

I know it's not correct because when I export (C-c C-e l o) from org to pdf, it doesn't open the pdf in Sumatra PDF. I have the configuration for tex --> pdf fw/backwrd sync b/w AUCTeX and Sumatra -- it works perfectly. I'd like the same for org and Sumatra too. Is it possible? If not, just opening with Sumatra instead of Adobe Acrobat Reader will do. Can someone please help me out here?


texts: org-capture evaluate each time without currying

texts:
Recently my org-mode config broke. And i started using ` and , to get it to work again. But now i have the issue that a function call (dl/capture-report-date-file) gets evaluated once and curries the time value (which is the time, and should be dynamic) for all future captures. I'd like it to get evaluated each time I capture, and have a different date each time. I am not an elisp dev.

(with-eval-after-load "org"
  (setq org-capture-templates
        `(("c" "manual-headline" entry
           (file ,(dl/capture-report-date-file
                   (concat org-directory "/notes")))
           "* SOON %?     \n:PROPERTIES:\n:CREATED: %U\n:SOURCE: %a\n:END:\n\n%i\n"))))


texts: Org-mode: clarify the concept and practice of archiving

texts:
My current org file (e.g. work.org) has 20+ DONE tasks and Org-mode becomes extremely slow: even moving the cursor takes a 2-3 seconds sometimes. I decide I have to archive these DONE tasks, but I found I don't know what Org-mode is actually doing to my text when archiving.

There are a few common options to archive:

archive subtree using the default command
C-c C-x C-a
It moves my subtree (a DONE task) from work.org to work.org_archive
move subtree to archive file
C-c C-x C-s
It also moves my subtree from work.org_archive
toggle ARCHIVE tag / to ARCHIVE sibling
C-c C-x a/A
It greys out my subtree (the DONE task) but the task remains visible on work.org when I expand the top tree. However, details of the subtree is not expandable, unless I do "force cycling of an ARCHIVEd tree" (C-TAB)

My questions are:
If I archive using #3, does the content of completed tasks stay in work.org? And does #3 offer already significantly performance improvement over a large Org file?

Also, if I archive using #1 or #2, how can I:
Search the archived contents on separate files? Do I just include the :archive: only? Or do I need to list and include all these files in my .emacs under org-agenda-text-search-extra-files?

And how do I refile a subtree by C-c C-w? Is it similar to refiling in other case: i.e. find the subtree in search by other ways, do a C-c C-w to move the subtree to the section I want, and then just save both the target org file and the .org_archive file in question. Is there other things I have to pay attention to?

My Emacs (25.1 64-bit in Windows10) just crashed...
Emacs (esp. Org mode) has become so slow and almost inoperable that typing on Firefox is quicker.


texts:
I'm using emacs from a terminal, and have noticed that certain commands make the terminal screen flicker when I use them.

Notable commands are evil mode's recenter-top-bottom and xref-find-definitions

This must surely be possible, as xref-pop-marker-stack, a command that has a very similar function as xref-find-definitions, does not have this issue. The whole terminal is not updated and doesn't give a flicker.

Is there any way of stopping this from happening? The flicker is quite annoying. This only appears to happen when emacs is run inside of a terminal.


texts: How do I move a buffer in spacemacs to a different window / frame

texts: Is there any keybinding or function to move an open buffer to a different window or a different frame in spacemacs?


texts: Configure key to toggle between active and inactive timestamps

texts:
By default, org-mode uses C-c . and C-c ! to create active and inactive timestamps respectively.
However, I also have flycheck installed which uses the C-c ! binding.

Thus, I'd like to use C-c . to insert timestamp and when prompted to enter the date+time in the minibuffer, use ! to toggle between active and inactive timestamps.

Is this possible? If yes, how would I go about it?


texts: Evil emacs use `dd` change buffer and paste with `p`?

texts:
I'm running evil emacs in terminal mode.

I have two files open in buffers I'm switching between with c-x, left/right.

I cut a line of text with dd then switch to another buffer and try to paste with p but I just paste some old text that I copied and pasted with right click earlier.

How can I move text like this when switching between buffers?


texts: How to use one binding to call different functions depending on whether the region is active?

texts:
As I only use kill-ring-save after I used set-mark-command, I wanted to try using its binding also for another command. However I'm not able to get this to work with an additional if. I don't know how to pass the arguments to avy-goto-char-2 with the interactive stuff.

How can I determine if the mark is active, and use that information to pick a function to call?


texts: Can I reuse Org's syntax highlighting in LaTeX mode?

texts:
Org-mode has a magical org-src-fontify-natively setting.  With this on, org highlights each code snippet using the corresponding mode's font-locking support.

Can I use this in LaTeX-mode? It would make editing small snippets in lstlistings environments much nicer!  By default, AucTeX highlights code snippets uniformly.


texts: Using org-src-preserve-indentation only on specific code blocks (or buffers, or anything beyond the global context, really)

texts:
I've been Googling and digging through the org-babel docs, but it's coming out with not a lot.

The thing is, one of things I'm working on is using org-babel to tangle Makefile source. In it, the documentation states, and I understand why it does, that I need to evaluate (setq org-src-preserve-indentation t), which I have, right now.

Thing is, I don't want to enable this value globally. I can understand that it makes sense for Python, Makefile, or other languages that are white-space sensitive, but I really don't want it enabled elsewhere. Plus, the end result of this is that the final org-file won't work for people who don't enable the value by default, so the resulting org-file is less portable anyway.

I'd prefer it if I could just enable org-src-preserve-indentation on a per code-block basis (it's extra typing, but I can live with that), but even a buffer-specific setting is acceptable. The thing is, I'm not sure how to do it.

I suspect that it could be done by taking advantage of how #+HEADER settings can eval Lisp code, but doesn't that mean that every time I tangle the file, or something, the setting is kept on every time? I'd rather not do that, that just makes the file unpredictable to use.


texts: Org-mode, how can I export my images in different float enviroment?

texts:
I need to export some images in different type of float in latex (i.e. \begin{map}).

An example of latex code is here.

How can I define image attributes in org-mode to achieve that?


texts: Handling left-to-right inside right-to-left paragraphs using Emacs and AUCTeX

texts:
I'm using Emacs to typeset a document which has English as its main language but which will use Hebrew and Greek as well.

You can see on my screenshot how the \footnote command shows two open brackets as opposed to the correct open and close brackets.

{\footnoteA{This is a Hebrew related footnote

as opposed to the correct way

\footnoteA{This is a Hebrew related footnote}

The end result however, on the PDF is correct.

This is a MWE:

\documentclass{article}
\usepackage{reledmac}
\usepackage{reledpar}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguages{greek, hebrew}
\setmainfont{SBL BibLit}
\begin{document}
\begin{pairs}
\begin{Leftside}
\beginnumbering
\begin{hebrew}
  \pstart

בְּרֵאשִׁ֖ית\footnoteA{This is a Hebrew related footnote} בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃

  \pend
\end{hebrew}
\endnumbering
\end{Leftside}
\begin{Rightside}
\beginnumbering
\begin{greek}
  \pstart
  Ἐν ἀρχῇ\footnoteA{This is a Greek related footnote} ἐποίησεν ὁ
  θεὸς τὸν οὐρανὸν καὶ τὴν γῆν.
  \pend
\end{greek}
\endnumbering
\end{Rightside}
\end{pairs}
\Column
\end{document}

Note how the text a line of Hebrew with mixed English characters is rendered correctly when edited using TextEdit (i.e. test editor that comes with MacOS)


texts:
I was switching to vim for the C-support mode, and then I discover yasnippet for emacs, it is awesome I love it !

So now I'm adding basic snippets to insert code and I am currently having a bit of difficulties to make a good for ( ...; ...; ... ) snippet.

I can do this :
    for ( $1; $2; $3 )

But I would like to have some defaults values, or else benefit from the mirror functionality of yast.

I know I can set default values with ${$1value} but in my case I think need to imbricate them, I haven't succeed trying it.
I ewplain what I'd like :
By default, I should be
    for ( int i = 0; i < $something; i++ )

With the possibility to modify the int type (could be nothing), the variable name, which I want to mirror in the second and third part, and the affectation.

The condition could also be different, but it needs to contain the first variable, same for incrementation.
Is it possible ?

It might be a better idea to keep it simple and define more snippets, I wonder if some of you have results with complex snippets.


texts:
This morning, I wake up and restart my Emacs.app (26.3 GNU Emacs but the emacsformacosx.com version, from brew cask) and get stuck at this:

Eager macro-expansion failure: (error "Loading file /Users/erik/.emacs.d/elpa/let-alist-1.0.6/let-alist.elc failed to provide feature ‘let-alist’") [2 times]

The built-in version of let-alist was 1.0.5, upgraded to 1.0.6, to no avail.


texts: Rename scratch buffer and ask confirmation to kill non-file buffers created by user

texts:
I tend to use often non-file buffers kinda like post-it-notes and it is way too easy to kill them inadvertently, as there is no confirmation to kill. Even if you enforce the habit of writing only  in file buffers (subject to confirmation), you might still inadvertently write in a non-file buffer.

Therefore,  I created a kill-hook to ask kill confirmation, but only for buffers that I created (setting global buffer-offer-save would make Emacs unusable).  To identify user buffers, I exploit the fact that the name of buffers created automatically starts with a star.

Now, given its prominence, I would like to use the *scratch* buffer as a note taking buffer too.
In this case, to fit the Emacs naming convention, I need to rename it scratch (or anyway something without the star).

I see two possibilities:

I prevent its creation: in the kill hook I check if I am going to kill the last buffer and create my scratch, to prevent the creation of Emacs' *scratch*.
I look for a create create-scratch-buffer hook and rename the scratch here.

As for point 1, (length (list-buffers)) includes also so called non-interesting (hidden) buffers and  I would happily avoid to parse names with regexp on every hook call (to detect interesting buffers).

As for point 2, how can I detect the scratch buffer creation? Perhaps with a mode hook, e.g. something like:

(add-hook 'after-change-major-mode-hook 'rename-scratch)

My actual kill hook follows.

(add-to-list 'kill-buffer-query-functions   'ask-before-killing-user-buffer)
(defun ask-before-killing-user-buffer ()
  "If the current buffer is a user buffer, ask for saving before killing.
Here a user buffer is one not: associated to a file, belonging to a process or auto-created by Emacs.
The latter are considered such when starting with the usual `*'.
The proposed filename will not be accepted if any buffer is already visiting the file"
  (interactive)
  (let* (save-name visited-by exit-while-p
           (ask "Save file as: ")
           (buffer (current-buffer))
           (buffer-name (buffer-name))
           (user-buff-p (if (or (string-match  "^ \\|\\*" buffer-name)
                    (get-buffer-process buffer)
                    (buffer-file-name)) nil t)))

    ;; Ask to save modified buffer
    (if (and user-buff-p (buffer-modified-p))
    (if (y-or-n-p (format "`%s' was modified; save it? " buffer-name))
        (progn
          ;; accept only non visited file names
          (setq default-directory DEFAULT-SAVE-DIR)
          (while (not exit-while-p)
        (setq save-name (file-truename (read-file-name ask nil nil nil buffer-name)))
        (setq visited-by (find-buffer-visiting save-name))
        (if visited-by
            (setq ask (format "`%s' is being visited by buffer `%s'.\nPlease choose another name: "
                      save-name (buffer-name visited-by)))
          (setq exit-while-p t)))
          (write-file save-name t))))

    t))

UPDATE

Try to answer to your comments, clarifiying  what I am willing to achieve.

I have a shortcut creating buffers named scratch1, scratch2, etc to readily  copy snippets from web pages or from ebooks, to type a nearby task, the draft of an email, etc. Normally these are ephemeral buffers never translating into files, they  live  until the text snippets  are  copied in actual documents (but occasionally the buffer is edited and saved).   Important original material gets immediately the status of file-buffer (with  the related backup facilities); it is anyway unpleasant to accidentally kill my scratches, despite I can recover them going on the source web page, ebook etc. Just like it is not crucial to lose your remember-the-milk notes, but ...

Currently using a mode hook seems to me a solution without to much overhead:

(defun rename-scratch-buffer ()
  (if (and (get-buffer "*scratch*") (not (get-buffer "scratch")))
      (with-current-buffer "*scratch*"  (rename-buffer "scratch"))))
(add-hook 'after-change-major-mode-hook 'rename-scratch-buffer)


texts: create a keybind to jump directly to a specific gnus mailbox summary view?

texts:
I want to be able to jump directly via a keybind to a specific mailbox summary view in gnus.

for example in the groups view i have a mailbox

*        0: nnimap+zeltak:INBOX

i want to be able to jumo directly to the summary view of the above bookmark. anyone know if thats possible?


texts: When in Org Agenda C-S on a task allows to set a date and a time, like for example SCHEDULED: <2020-10-20 mar. 10:00>. I'd like to set a time slot (e.g. from 10:00 to 12:00) instead of an hour (e.g. 10:00).


texts: Regexp replacement: difference between \([[:digit:]]+\) and ([[:digit:]]+)

texts: With M-x replace-regexp, I found that both  \([[:digit:]]+\) and ([[:digit:]]+) will match (123), and not one without parentheses, But the first will replace 123 and the second (123). I wonder why the difference?


texts:
I recently learned that some former MELPA libraries are now  available only from the EmacsWiki.

Let aside security implications,

Is there an equivalent of M-x package-list-packages for those libraries?
Is there an equivalent of (use-package foo), which I could put in my init file?
Any best practice suggested to deal with EmacsWiki libraries?


texts:
There's lots of documentation about inserting or storing org-mode-links, but apparently none about copying them to buffers in other formats.

How do you copy the URL of an org-mode-link from an org file into the clipboard/kill ring with as few keystrokes as possible? I tried org-store-link and org-insert-link, but it dumps the whole org-mode syntax into whatever other buffer you have open.

Example: buffer 1 org-mode, buffer 2 Markdown.

Visit buffer 1, C-s search for link.
Magic happens, URL is in clipboard
Visit buffer 2. C-y to yank URL into buffer.


texts: config hex mode to show data byte by byte

texts:
By default, the hexl mode will show binary data two bytes by two bytes as below:

00000000: 0000 0020 6674 7970 6973 6f6d 0000 0200  ... ftypisom....

Is it possible to change the style to show data byte by byte? just like below:

00000000: 00 00 00 20 66 74 79 70 69 73 6f 6d 00 00 02 00  ... ftypisom....

Or any other better hex edit package available for emacs?


texts: Differences between "helm-follow-mode" and "follow-mode"

texts:
"helm-follow-mode" vs. "follow-mode"
Basically: what is the difference between their behaviours?


texts: C-g doesn't work within Counsel's action menu (M-o)

texts:
Let's say I'm completing a file with counsel-find-file.  I then press M-o to show the menu with available actions.  If within that menu, I press C-g, I get the message "C-g is not bound".

The expected behavior would be for the menu to quit (and to go back to where I was completing the file name).

How can I set the behavior I want?  (I don't know what is the keymap used by Counsel's menu and also don't know how to quit the menu).


texts:
I have Emacs doing a bunch of smart things to display text for me. In particular, some text has the invisible property set, and I'm running adaptive-wrap with <!-- adaptive-wrap-extra-indent: 3 --> set. I'm wondering whether I can copy the text as it's rendered in Emacs, with newlines to re-create the smart line wrapping and with the invisible text gone. Is there a way I can access the text from my buffer in that form?

What I want is essentially the same as running emacs -nw, selecting the text using the terminal's text selection capabilities, and then using the terminal app's copy function (not marking using an Emacs region and then yanking). The chief problem with this technique for me is that I have to do it one screen at a time.

Running htmlfontify-buffer gets me part of the way there. My visible text is shown by I can make it go away by clicking on each individual instance, but the line-wrapping behavior is lost.


texts: Have short comments at bottom of table in org mode (beamer/latex export)

texts:
I'm trying to make a table like so:

|   |  x |   y |
| a | 12 | 354 |
| b | 45 |  65 |

Then when I export it to pdf via beamer/latex I'd like to have a short comment below it (like Souce: www.google.com). Is this possible to do?


texts: Emacs26 -- (1) view PDF with Okular; (2) compile TEX file silently

texts:
I am running Emacs 26 built with GTK toolkit.  AUCTeX has been successfully installed.

1) How to force Emacs to open an Okular session to view the PDF file, instead of opening another window within Emacs (aka DocView)?

2) How to delegate the running of a TeX file to the background (i.e., something like a "quiet" mode when it would not open up a visible new window, but do it in the background)?


texts: How can I redefine a key that is currently used as the start of a key sequence?

texts:
I want to redefine C-w to run one of my commands. evil has already defined a number of key sequences that start with C-w to run its commands. So my command does not run, Emacs just waits for me to complete the sequence.

Is there a way I can undefine all existing sequences starting with C-w so that Emacs will then run my C-w command?


texts:
Having got a bunch of custom colors defined (thanks to Drew), I need to use them to customize the background color per host. I have named the colors after the hostname, eg

(setq pentacle "#314159")
(setq athame "#271828")

so then I tried (at the bottom of the .emacs file)

(set-background-color (nth 0 (split-string (system-name) "\\.")))

but on (for example) pentacle.mydomain.com I get the message in the minibuffer

Undefined color: "pentacle"

I assume I need one or more additional levels of indirection in expanding the system name and splitting off the first token from the FQDN, but I can't see how to do this so that it gets recognized as the variable I defined.


texts: Weird behavior: GUI won't start, but terminal emacs will

texts:
As I said in the title, I'm having a problem with starting Emacs, whenever I try to start it with rofi, nothing happens, and when I try and start with terminal (using emacs), it returns "Args out of range: 0, 100" without opening up Emacs. Whenever I use Emacs in terminal however (with emacs -nw), it starts just fine. This behavior continues even after I moved my .emacs.d directory to .emacs.d.bak and even after I uninstall and reinstall Emacs. Any ideas what is going on and how I can fix this?

Here is my configuration myinit.org init.el

edit:

OS: Arch Linux  Emacs version: 26.1