texts: How to use C-j C-k to move window in term mode using evil?

texts:
The bindings of C-j C-k to evil-window-down[up] work well every where apart form term mode. term mode rebinds these to C-w j C-w k - this is super annoying!
How can i make term use the C-j/C-k bindings I use every where else?
At the moment i'm doing this:
(define-key evil-motion-state-map (kbd "C-h") 'evil-window-left)
(define-key evil-motion-state-map (kbd "C-j") 'evil-window-down)
(define-key evil-motion-state-map (kbd "C-k") 'evil-window-up)
(define-key evil-motion-state-map (kbd "C-l") 'evil-window-right)

(define-key evil-normal-state-map (kbd "C-h") 'evil-window-left)
(define-key evil-normal-state-map (kbd "C-j") 'evil-window-down)
(define-key evil-normal-state-map (kbd "C-k") 'evil-window-up)
(define-key evil-normal-state-map (kbd "C-l") 'evil-window-right)

(define-key global-map (kbd "C-h") #'evil-window-left)
(define-key global-map (kbd "C-j") #'evil-window-down)
(define-key global-map (kbd "C-k") #'evil-window-up)
(define-key global-map (kbd "C-l") #'evil-window-right)

But term and Python Inferior REPL processes override them.


texts: How do I make auto-complete enabled by default

texts:
I'm running GNU Emacs 24.4.1 on a clean install of Debian 8.1.  I've installed auto-complete using the package manager.  It is installed and if I type M-x auto-complete-mode I get a working auto-complete.  I would like to have it enabled by default.  I added the following to my .emacs file:

(require 'auto-complete)
(global-auto-complete-mode t)

However, that resulted in the error:

Warning (initialization): An error occurred while loading `/home/greg/.emacs':

File error: Cannot open load file, no such file or directory, auto-complete

So, I tried adding to the load path with a bunch of different attempts like:

(add-to-list 'load-path' ("~/.emacs.d/elpa/")

OR

(add-to-list 'load-path (file-name-as-directory
                     (expand-file-name "~/.emacs.d/elpa/auto-complete-20151211.227/auto-complete"))
                     )

But nothing seems to do the trick.  If I use C-h v load-path when I run emacs with --debug-init, I can see what I've added to the load path, but even when it looks correctly I still get the same can't load file error.

I've read other similar questions but these are all the things their answers said to try and I still can't get it to work.  How do I get auto-complete to load automatically?


texts: Completion of sentences stored in a file

texts:
I know this question is similar to completion of a sentence rather than word but I ask anyway since I suggest another way of storing what is supposed to be auto-completed.

Suppose I stored some sentences in a file. How could I, in the current buffer, complete the sentences from this file just by typing the beginning (or, better, any part) of them?

Edit: To be more explicit, here is the context: I'm in the process of grading (maths) exams and most of the positive and negative remarks I have to express (and to write down) about my students works are the sames.

Hence, suppose I have the following sentences in a sentences.txt file:

Please, don't take your dreams for reality: (a + b)² ≠ a² + b².
Please, don't take your dreams for reality: cos(a + b) ≠ cos a + cos b.
You should revise the derivatives.
No, √(a²) ≠ a.
This only works for a positive x.

I'd like to be able in my current buffer (of a file stored, say, in the same directory as sentences.txt) to type e.g.

  Please

and to be prompted with the first two sentences in a drop down list, just as does autocomplete for the (single) words of the current buffer.


texts: How can I apply faces interactively under `font-lock-mode`?

texts:
font-lock-mode sets font lock for the entire buffer -- normally to provide syntax highlighting.  Sometimes though, when I'm preparing a tutorial, I want to call attention out to certain lines.  It would be great if I could underline them (M-o u with active region), but it has no effect with font-lock-mode.

How can I use or emulate M-o (facemenu-keymap) with font-lock-mode?


texts: Why unicode  (poker card) can't be properly displayed in GUI but fine in TUI?

texts:
I'm having a hard time getting unicode to properly displayed in GUI.
I'm trying to type poker cards unicode inside emacs GUI,   for instance. I would like to use font "Ubuntu Mono",

NOT Symbola.

Here's what's really weird:

Symbola works fine in GUI, as long as I have it installed.
If I remove Symbola from my system, GUI will only show ugly hex-code block, which is glyphless fallback.
TUI emacs is fine and shows the non-Symbola version. (Needless to say  can be properly displayed in terminal vim as well) Also, gedit and gvim works fine also. LibreOffice works fine as well.

To sum up, on my setting, I'm only experiencing problem with GUI emacs, which is really weird, since plenty of fonts installed on Ubuntu by default can display .
I'm wondering if there's some problem with my system setting or my build of emacs. Also, this link doesn't work for me. I'm getting display: no font available on my GUI.
             position: 1 of 1384 (0%), column: 0
            character:  (displayed as ) (codepoint 127145, #o370251, #x1f0a9)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x1F0A9
               script: playing-cards
               syntax: w    which means: word
             category: .:Base
             to input: type "C-x 8 RET 1f0a9" or "C-x 8 RET PLAYING CARD NINE OF SPADES"
          buffer code: #xF0 #x9F #x82 #xA9
            file code: #xF0 #x9F #x82 #xA9 (encoded by coding system utf-8-unix)
              display: no font available

Character code properties: customize what to show
  name: PLAYING CARD NINE OF SPADES
  general-category: So (Symbol, Other)
  decomposition: (127145) ('')

There is an overlay here:
 From 1 to 3
  face                 hl-line
  priority             -50
  window               #<window 3 on test.el>

There are text properties here:
  fontified            t

[back]

Tested environment:
Ubuntu 16.04 / 18.04
emacs 27.1
Spacemacs develop / emacs -Q

Edit:
A few details in the comment below.
When Symbola is installed, the following can be observed.
;; C-x C-e turns  into ugly hex-code
(set-fontset-font nil ? "Ubuntu Mono")

;; C-x C-e turns  into what's shown in the Symbola image
(set-fontset-font nil ? "Symbola")

;; This line actually works, but I have no idea why
(set-fontset-font nil 'playing-cards (font-spec :script 'playing-cards))


texts: iBuffer: Symbol's value as variable is void: ibuffer-never-show-regexps`

texts:
emacsWiki/IbufferMode

Hide certain buffers
Here’s how to hide all buffers starting with an asterisk.
(add-to-list 'ibuffer-never-show-regexps "^\\*")

But when I added into my init file I am getting following error:
Symbol's value as variable is void: ibuffer-never-show-regexps. What may be the reason for it?


texts: Why does use-package considers "emacs" as a package?

texts:
In the use-package documentation https://github.com/jwiegley/use-package#diminishing-and-delighting-minor-modes there is an example that considers emacs as a package(i.e (use-package emacs))
Usually the installed packages reside in the subdirectory of '~/.emacs.d/...'. How does use-package handle the package emacs ? Is it handled as a special case ?


texts:
I learned that M-x invokes command execute-extended-command.

Extended commands - GNU Emacs FAQ

What command does C-x invoke?
I looked through the reference but failed to find the answer.


texts: How can I avoid escaping quotes when I export an org file to markdown?

texts:
"foo" becomes &ldquo;foo&rdquo; when I run org-md-export-as-markdown

I just want it to export to "foo". How can I fix this?


texts: Can emacs support go to declaration of function in an entire project?

texts:
Does emacs have a function or library that can allow the user to go to the function declaration even if it was defined in another file?

If so, what languages is there support for?

The inspiration for this question, comes from the below article which talks about some of the reasons why emacs will never be able to compete with IDE's.

http://henrikwarne.com/2012/06/17/programmer-productivity-emacs-versus-intellij-idea/


texts:
I have Emacs installed through Termux.  The Emacs manuals (emacs.info.gz, etc.) are located at /data/data/com.termux/files/usr/share/info/.  I can open them with find-file.  I don't see them with C-h i.

The INFOPATH is set in ~/.bashrc:

# .bashrc
export INFOPATH=$INFOPATH:/data/data/com.termux/files/usr/share/info/

A new Termux session shows the correct INFOPATH.  The path above is the Info-default-directory-list and is the last entry in Info-directory-list.

The texinfo, gzip, and zlib packages are installed in Termux.

I can see the manuals for Magit, use-package, etc. listed in  *info*.

How can I access the Emacs manuals through Info?


texts:
would like to use a custom tikz library with org-mode.
https://github.com/jluttine/tikz-bayesnet

The following example works fine. :)

#+begin_src latex :file fsa.pdf :packages '(("" "tikz")) :border 1em
  % Define block styles
  \usetikzlibrary{shapes,arrows}
  \tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, fill=blue!25]
  \tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, fill=red!25]

  \begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node distance=2.8cm, semithick]
    \node [astate] (1) at (0,0) {1};
    \node [astate] (2) at (1,0) {2};
    \node [rstate] (3) at (2,0) {3};
    \path (1) edge [bend left] node {b} (2)
          (2) edge node {b} (3)
          (2) edge [bend left] node {a} (1)
          (3) edge [loop above] node {(a, b)} (3);
  \end{tikzpicture}
#+end_src

but using the downloaded bayesnet library doesn't work.

#+begin_src latex :file figs/fmc_model.png :packages '(("" "tikz")) :border 1em
  % \usetikzlibrary{bayesnet}
  % \include{tikzlibrarybayesnet.code.tex}
  \begin{tikzpicture}
    % Define nodes

    % Y
    \node[obs]          (y)   {$y$}; %
    \factor[above=of y] {y-f} {left:$\mathcal{N}$} {} {} ; %

    % W and X
    \node[det, above=of y]            (dot) {dot} ; %
    \node[latent, above left=1.2 of dot]  (w)   {$\mathbf{w}$}; %
    \node[latent, above right=1.2 of dot] (x)   {$\mathbf{x}$}; %

    % W hyperparameters
    \node[const, above=1.2 of w, xshift=-0.5cm] (mw) {$\mu_w$} ; %
    \node[const, above=1.2 of w, xshift=0.5cm]  (aw) {$\alpha_w$} ; %

    % X hyperparameters
    \node[const, above=1.2 of x, xshift=-0.5cm] (mx) {$\mu_x$} ; %
    \node[const, above=1.2 of x, xshift=0.5cm]  (ax) {$\alpha_x$} ; %

    % noise
    \node[latent, right=2.5cm of y-f]         (t)   {$\tau$}; %
    \node[const, above=of t, xshift=-0.5cm] (at)  {$\alpha_\tau$} ; %
    \node[const, above=of t, xshift=0.5cm]  (bt)  {$\beta_\tau$} ; %

    % Factors
    \factor[above=of w] {w-f} {left:$\mathcal{N}$} {mw,aw} {w} ; %
    \factor[above=of x] {x-f} {left:$\mathcal{N}$} {mx,ax} {x} ; %
    \factor[above=of t] {t-f} {left:$\mathcal{G}$} {at,bt} {t} ; %
    \factoredge {dot,t} {y-f} {y} ; %

    % Connect w and x to the dot node
    \edge[-] {w,x} {dot} ;

    % Plates
    \plate {yx} { %
      (y)(y-f)(y-f-caption) %
      (x)(x-f)(x-f-caption) %
      (dot) %
    } {$N$} ;
    \plate {} {%
      (y)(y-f)(y-f-caption) %
      (w)(w-f)(w-f-caption) %
      (dot) %
      (yx.north west)(yx.south west) %
    } {$M$} ;

  \end{tikzpicture}
#+end_src

The result is the same as when I compile the figure in a standalone latex file without '\usetikzlibrary{bayesnet}'.

If I include the library in the org-mode fragement doesn't compile.
In latex the '\usetikzlibrary{bayesnet}' command finds the library when it's located in the same folder (which it is) and produces the expected result.

So how can I make org-mode aware of the file tikzlibrarybayesnet.code.tex which is located in the project directory?


texts: Importing Emacs Stack Exchange Queries Into Emacs by tags

texts: Is there any plugin already available to import Emacs Stack Exchange Queries Into Emacs, filtered by certain tags.  Like the news reader, read mail packages. Wondering if a package is  already in use to get sx queries into emacs. I got so much time now for the lock-down I plan to tinker with emacs and copy paste from stack exchange smartly.


texts: regular expression whole word replace, whitespace only

texts:
Some modes treat underscores as word boundaries.

I am using evil via spacemacs.  I am trying to use a vim/sed style :%s/foo/bar/g search and replace, but operate only on whitespace delimited words, not underscores.

As an example, if I have the following:

num_foos_
foos_

and I want to rename only foos_ to bars_.

I have tried the following:

:%s/foos_/bars_/g : matches both num_foos_ and foos_
:%s/\bfoos_/bars_/g : matches both num_foos_ and foos_ (I guess because _ is a word boundary, so \b matches num_foos_)
:%s/\bfoos_\b/bars_/g : matches neither (I guess because _ is a word boundary, and there is no word after the trailing _)
:%s/\<foos_/bars_/g : matches both num_foos_ and foos_ (I guess for the same reasons as \b)

How can I match only foos_ and not num_foos_?


texts: Autofill insert a special string before returning

texts:
I use autofill in org mode to return automatically after 80 characters, the thing is that when exporting to html newlines aren't automatically added.

So I would like to know if it is possible to tell autofill (or someone else) to insert a double backslash \\ after 80 characters.

Thank you


texts: Global display line numbers mode not working

texts:
I can run (display-line-numbers-mode) and get line numbers but it doesn't work if I run (global-display-line-numbers-mode) (nothing happens). I have traced this to this function:

(defun display-line-numbers--turn-on ()
  "Turn on `display-line-numbers-mode'."
  (unless (or (minibufferp)
              ;; taken from linum.el
              (and (daemonp) (null (frame-parameter nil 'client))))
    (display-line-numbers-mode)))

Sure enough I am running my emacs in daemon mode (I have no idea why that would prevent me from wanting line numbers?) and the frame-parameter call is returning nil. I am connecting with a GUI instance of emacsclient. Any idea what this is trying to do and if it is actually necessary?


texts: Possible to access the second-last clipboard contents (clipboard history)

texts:
Is there a way to access the second last value of the clipboard in Emacs?
I assume it's possible to make this work within Emacs.

Intercept the copy function.
Read the clipboard and add it to a list.
Set the clipboard as expected.

Note, the reason I'm asking this is I'd like to make a shortcut to paste the second last item in the clipboard, so I can copy things while keeping access to what was already in the clipboard.


texts: Why after save *Occur* buffer I can't edit editable file?

texts:
Emacs 26.1, Windows 10 (64 bit)

I open file trace.log. User occur to find text. Save occur buffer to file NXS_ETH.txt. Do some manipulations. See screenshots. But I can't edit EDITABLE file.

Here steps:

Save occur buffer to file:

File is EDITABLE (not read-only).

Remove Face and text properties:

I press "a" but char "a" not show in buffer. I get message on minibuffer:

a is undefined

What is this?

To fix this I reopen file NXS_ETH.txt and then success edit buffer.

Why I can't input any text after save occur buffer to the file?


texts: What are the major features planned for GNU Emacs 25?

texts:
I attempted to install Emacs 24.4 through homebrew with the following command:

brew install emacs --HEAD --use-git-head --cocoa --with-gnutls

It ended up installing (a development build toward what might become) Emacs 25. I haven't been able to find any information about Emacs' roadmap, but since this version is in development I'd assume there is some sort of plan. What are the major features that are planned for Emacs 25?


texts: How to filter agenda headings not just by date but also time of day

texts:
If I (setq org-agenda-todo-ignore-scheduled 'future), then my agenda view will now show tasks that are scheduled for tomorrow or later. But this setting does not appear to take the time of day into account.

If now is <2018-02-15 Thu 12:00>, it makes no difference if I annotate a task with SCHEDULED: <2018-02-15 Thu 05:00> or SCHEDULED: <2018-02-15 Thu 17:00>. Both will show up in the agenda.

This is a pity, because sometimes I want to snooze a task for an hour or two. But the minimal resolution of Org mode agenda views appears to be one day.

Is there a way to tell Org mode to take time of day into account when filtering agenda tasks?


texts: How to Change Separators of org-tag in org mode?

texts:
I'm a light user who use org-mode since 6 month ago. I think It's super useful mode to make GTD schedule and write a simple note.

but when I use org-mode I couldn't find the delimiters of tag except for : like :TAG:

what I want is changing delimiters of org-tag like TAG1|TAG2| or #TAG1#TAG2# ...

anyone how to do this?


texts: In a Helm prompt, how do I copy a candidate for editing?

texts:
Sometimes, I want to make a new file that's named similarly to an existing file. For example, I might want to copy a file to a second filename (foo.txt.backup), or move it to the right place (pretty-long-file-name.hmtl).

In these cases, I often want to take a candidate and modify it somehow, before selecting it. Is there a way to do that?


texts:
Suppose you had a large org document of recipes, with hundreds of entries like this:

* Tasty Pudding
** Ingredients
- Milk
- Sugar
- Eggs
- Flavorings
** Process
1. Mix the eggs and sugar
2. Heat up the milk and flavorings
3. Temper the milk into the egg mixture
4. Cook the pudding
** Description
It's my favorite pudding

But then you realize the description subheading is pointless and your recipes should be structured more like

* Tasty Pudding
It's still my favorite pudding, but it makes more
sense to have the description up here!
** Ingredients
...
** Process
...
** Notes
Here's my new additional thoughts about this
pudding.

Is it possible to either edit all of these entries at once, or ideally have some kind of "node" structure that these recipes are bound to?

So for example, I could see having a Yas Snippet like:

* $1
$2
** Ingredients
- $3
** Process
1. $4
** Notes
$5

But of course that would only work for your new recipes, it can't fix the old ones.


texts: profile-report doesn't show any report data

texts:
I used M-x profiler-start RET RET then after a few other operations I did M-x profiler-stop.

Then M-x profiler-report. It doesn't show any profile data.

I am using OSX.  Where is profile data supposed to be saved? and what is the file name supposed to be?


texts:
Hi is there a hook that gets triggered upon entering a LaTeX fragment in org? I'm trying to do

(add-hook <enter-org-latex-hook> 'org-cdlatex-mode)

but can't seem to find the correct hook to attach to.


texts:
I recently upgraded to (K)ubuntu 16.04 which includes Emacs 24.5.1. Since the upgrade, Emacs stalls for more than three minutes when opening any Python file. The problem occurs when opening a new Python file as well as on existing files. I tried eg.

emacs --no-init-file example.py

where the file can be a literal hello world program, non existing or any small Python script. The problem also occurs when opening a Python file after editing other files or when using dired to open the file. I left no extensions installed on that system.

CPU load and memory footprint are normal while Emacs stalls (below 1% on my system). Ctrl+G allows circumventing the problem. Once the first Python file has loaded, all other Python files load normally w/out delay.

I tried removing all configuration files

rm -r .emacs*

but that did not help either (note that I could not reproduce the problem on other (K)Ubuntu systems). The only message I get from Emacs is likely not related: "Warning: no abbrev-file found, customize `abbrev-file-name' in order to make mode-specific abbrevs work.". How can I get Emacs to be usable for editing Python files again?  Any hints are welcome. Thanks.


texts: How can I make Emacs back up files right after they are saved?

texts:
I have followed this answer's solution. My goal is to back up files right after I save them.
When I create a new file it is successfully backed up to the given path, but when I close and re-open Emacs the file that I was working on is not backed up or created. Please note that I have created new key bindings for saving and closing.
my setup:
(defvar --backup-directory (concat user-emacs-directory "backups_alper"))
(if (not (file-exists-p --backup-directory))
    (make-directory --backup-directory t))

(setq backup-directory-alist `(("." . ,--backup-directory)))
(setq backup-by-copying t)

(setq backup-by-copying t               ; don't clobber symlinks
      version-control t                 ; version numbers for backup files
      delete-old-versions t             ; delete excess backup files silently
      delete-by-moving-to-trash t
      kept-old-versions 6               ; oldest versions to keep when a new numbered backup is made (default: 2)
      kept-new-versions 9               ; newest versions to keep when a new numbered backup is made (default: 2)
      auto-save-default t               ; auto-save every buffer that visits a file
      auto-save-timeout 20              ; number of seconds idle time before auto-save (default: 30)
      auto-save-interval 200            ; number of keystrokes between auto-saves (default: 300)
      )

;; my save:
(defun my-save-all () "My doc-string."
       (interactive)
       (let ((message-log-max nil)
             (inhibit-message t))
         (save-some-buffers t)))

(defun save-all ()
  (interactive)
  (my-save-all)
  (bk-kill-buffers "magit: project")
  (bk-kill-buffers "__init__.py")
  (bk-kill-buffers "*helm"))

(define-key ctl-x-map "\C-s" 'save-all)

;; closing emacs
(defun my-kill-emacs ()
  "save some buffers, then exit unconditionally"
  (interactive)
  (my-save-all)
  ;; (save-some-buffers nil t)
  (save-buffers-kill-terminal))

(global-set-key (kbd "C-x C-c") 'my-kill-emacs)


texts:
I need to replace guid_here by different uuid.

provider [guid_here]
[guid_here] provider
test again [guid_here]
test again2 [guid_here]
test [guid_here] again2

I use this approach.

Install package "uuid" - UUID

I need create uuid exactly in the cursor place.
To do this I create custom function:

  (defun uuid-insert()
      (interactive)
      (require 'uuid)
      (insert (upcase (uuid-string))))

and bind to key:

(global-set-key (kbd "C-c C-'") 'uuid-insert)

Also I need  package multiple-cursor multiple-cursor

and here steps.

Select guid_here

Use mc/mark-all-like-this

Press Del

Use my custom function uuid-string to insert uuid in every line. I must use keybinding for this - C-c C-' . If use by function name uuid-string it's not work.

As you can see, now in every line has different uuid. Nice.

It's very cool.

Is it best approach to generate uuid in every lines?


texts: How can I re-enable `C-z` in evil mode (to pause Emacs)?

texts:
I have been using Emacs for a while and recently started using evil mode. I exclusively use emacs-nox (command line emacs).
The only thing that's missing for me is C-z to pause emacs and bring me back to my bash shell.
For some reason when evil mode is enabled, the C-z hotkey does nothing. When I disable evil mode, C-z works just fine. I have never used vi/m before, so I'm not sure if there is a vi/m specific command to pause (I'm pretty C-z in vi will pause it as well). I understand that C-z is a bash command, not an Emacs hotkey. I'm not sure why it is interrupted by evil mode.


texts: How to make statistics cookies count any TODO entries in the subtree for the whole document?

texts:
By default statistics cookies count the number of TODO in the immediate children, not in the full subtree. E.g.

* Test [0/0]
** Task1
*** TODO Subtask 1
*** TODO Subtask 2

It is possible to change this behavior for a single tree:

* Test [0/2]
  :PROPERTIES:
  :COOKIE_DATA: recursive
  :END:
** Task1
*** TODO Subtask 1
*** TODO Subtask 2

Or for globally for all the documents:

(setq org-hierarchical-todo-statistics nil)

Is there a way to set this this on per-document basis?


texts: list marked files in dired in another buffer

texts:
I want to list particular files in a buffer, with each file on its own line. I want to be able to choose the files to list from a Dired buffer.

I tried copying file names to the clipboard, and then pasting what I copied, but that puts all of the file names on the same line. For example if I mark these file nams

Slide1.JPG
Slide2.JPG
Slide3.JPG

issue 0w

then paste and they are all in 1 line:

/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide1.JPG/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide2.JPG/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide3.JPG

I instead want each file to have its own line so it will look like this:

/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide1.JPG

/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide2.JPG

/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide3.JPG

any clue?


texts:
In describe-mode's definition (in help.el), there's the following piece of code:

;; Older packages do not register in minor-mode-list but only in
;; minor-mode-alist.
(dolist (x minor-mode-alist)
  (setq x (car x))
  (unless (memq x minor-mode-list)
    (push x minor-mode-list)))

How big a concern is this? If I wanted to get a canonical, comprehensive list of minor modes, is it enough to check minor-mode-list, or is doing the above really necessary?

It's fine to be "on the safe side", but describe-mode already makes some powerful assumptions, such as that the control variable for a minor mode has the same name as its toggle command (see define-minor-mode) for more information, so it's a probably not getting "everything" to begin with.


texts: Custom configuration layer for multi-term is ignored

texts:
I've created a new configuration layer (read more about it below) for multi-term but the settings specified there don't seem to apply.

Here is the code in particular

;;; packages.el --- rgp-multi-term Layer packages File for Spacemacs

(defun rgp-multi-term/init-multi-term ()
  "Initialize rgp-multi-term"
  (use-package multi-term
    :commands multi-term
    :defer t
    :init
    (progn
      (setq multi-term-program "/bin/zsh")
      (add-hook 'term-mode-hook (lambda() (setq yas-dont-activate t))))))

Multi-term itself works fine, but when I check for the value of multi-term-program it returns nil
So just to clarify, my problem is that the settings I specify in my configuration layer aren't applying.

I successfully added many other layers but I'm having some kind of problem with this one in particular.

Any ideas what's going on?

Thanks!

NOTE: A configuration layer is an Spacemacs specific term. It's basically a place to place some settings for a particular package. It uses the same syntax as the use-package package.


texts: Creating a new function based off exisiting one

texts:
I apologize if this is a duplicate, but the essence of the question is whether it is possible to create "around" advice for an existing function and bind that to a new one.

In my case, I'm trying to change how evil-delete and similar functions handle the kill ring, namely by inserting into the second position instead of the first. I already have a function that accomplishes this, called yf-kill-new-second-pos, however I cannot figure out how to cleanly define a derivative of evil-delete that uses this instead of kill-new without either copying and pasting or (I admit I haven't tried this) advising evil-delete, which would undesirably change it's functionality.

I attempted to solve the issue by using symbol-function to grab the source for evil-delete and then wrapping that in an flet to redefine kill-new, but that did nothing to change the function's behavior (even when set to nil). Code:

(evil-define-operator yf-d (beg end type register yank-handler)
  "Evil-delete that dumps to 2nd in kill ring by default"
  ;;Same interactive clause as evil-delete
  (interactive "<R><x><y>")
  (cl-flet ((kill-new #'yf-kill-new-second-pos))
    (funcall (symbol-function 'evil-delete) beg end type register)))

;;testing measure
(bind-key (kbd "<f7>") 'yf-d)

This may not be changing anything because evil-delete is byte-compiled, but I'm not entirely sure. It could also have something to do with evil-define-operator, but again, I don't know how to test around this. Any help in solving this issue would be greatly appreciated :)


texts: How to measure the performance of the mode-line?

texts:
Currently when making changes to the mode-line, I try to write efficient elisp,
However I don't know for sure if what I'm doing is in fact efficient.
How could I test the mode-line performance?
For example - redraw the mode-line in a loop and time that.


texts: Exporting org-mode file to LaTeX with different document font

texts:
The default for exporting to LaTeX from org-mode files is to have the article document class at size 11pt font \documentclass[11pt]{article}.

How do I get the exported LaTeX file to be a specified font size, namely 12pt?


texts:
History

Recently,  I cobbled together a shell script that can execute a named code block from inside an org-mode file using the command-line.

I copied source code directly from the org-mode manual and the org-babel-open-src-block-result function in ob-core.el.

At the moment, the shell script only works with elisp code blocks.

  # Shell Command
  ./call-named-code-block-examples.sh ./call-named-code-block-examples.org "get-org-version" 2>/dev/null
  # Returns Expected Results
  # org-mode version: 9.0

The script displays an error when calling code blocks written in other languages, e.g. ruby.

  # Shell Command
 ./call-named-code-block-examples.sh ./call-named-code-block-examples.org "get-emacs-version"
  # Returns Error Message
  # No org-babel-execute function for ruby!

Question

How to execute named code blocks written in any language using a shell script?

  Below is the shell script and org-mode code needed to reproduce the issue:

Shell Script

Save as file named: call-named-code-block-examples.sh

#!/bin/sh
# -*- mode: shell-script -*-
#
# Call named code block in org-mode file
#
DIR=`pwd`
FILE=$1
CODE_BLOCK=$2

emacs -Q --batch \
  --eval "
(progn
  (require 'org)(require 'ob)(require 'ob-table)(setq org-confirm-babel-evaluate nil)
  (mapc (lambda (file)
        (find-file (expand-file-name file \"$DIR\"))
        (let ((re-run (quote t))
          (results (quote \"ERROR: Did not call code block: $CODE_BLOCK\")))
    (save-excursion
      (org-babel-goto-named-src-block \"$CODE_BLOCK\")
      (let ((info (org-babel-get-src-block-info 'light)))
        (when info
          (save-excursion
        ;; go to the results, if there aren't any then run the block
        (goto-char (or (and (not re-run) (org-babel-where-is-src-block-result))
                   (progn (org-babel-execute-src-block)
                      (org-babel-where-is-src-block-result))))
        (end-of-line 1)
        (while (looking-at \"[\n\r\t\f ]\") (forward-char 1))
        ;; open the results
        (if (looking-at org-bracket-link-regexp)
            ;; file results
            (org-open-at-point)
          (let ((r (org-babel-format-result
                (org-babel-read-result) (cdr (assq :sep (nth 2 info))))))
            (pop-to-buffer (get-buffer-create \"*Org-Babel Results*\"))
            (delete-region (point-min) (point-max))
            (insert r)
            (setq results (buffer-string))))
        t)))
      t)
    (princ (format \"%s\" results))
    )

      (kill-buffer))
    '(\"$FILE\"))
  )
"

Named Code Block Examples

Save as file named: call-named-code-block-examples.org

#+NAME: get-org-version
#+BEGIN_SRC elisp
(format "org-mode version: %s" (org-version))
#+END_SRC

#+RESULTS: get-org-version
: org-mode version: 9.0

#+NAME: get-emacs-version
#+BEGIN_SRC ruby  :var emacs_version=(format "Emacs Version: %s" (substring (version) 10 16))
  emacs_version
#+END_SRC

#+RESULTS: get-emacs-version
: Emacs Version: 24.5.1


texts: org-map-entries says "Wrong type argument: char-or-string-p, nil"

texts:
I have this code:
(defun org-get-logbook-notes ()
  (save-excursion
    (unless (org-at-heading-p)
      (outline-previous-heading))
    (when (re-search-forward ":LOGBOOK:" (save-excursion
                                           (outline-next-heading)
                                           (point))
                             t)
      (let* ((elt (org-element-property-drawer-parser nil))
             (beg (org-element-property :contents-begin elt))
             (end (org-element-property :contents-end elt)))
        (buffer-substring-no-properties beg end)))))

(require 's)

(defun my/org-rotten-set ()
(interactive "P")
(setq lognotes (org-get-logbook-notes))
(setq numresched (number-to-string (s-count-matches "Rescheduled from" lognotes)))
(org-entry-put nil "ROTTEN" numresched ))

What it should do is simply the following task:

Get the contents of the :LOGBOOK: drawer
Count how many times the string "Rescheduled from" occurs
Transform this into a number and create a property "ROTTEN" with this number as a value

If I use IELM, place the point inside a single entry in my orgfile and execute
ELISP> (my/org-rotten-set)

This works perfectly fine. The occurences of "Rescheduled from" will be count, the "ROTTEN" property will be created.
Now if I try to use this function together with org-map-entries it doesn't work.
ELISP> (org-map-entries 'my/org-rotten-set)
*** Eval error ***  Wrong type argument: char-or-string-p, nil

What am I doing wrong here?
It seems to be related to the org-get-logbook-notes function that I defined a the beginning, but I have no idea why?


texts: Org agenda view: how to express OR when filtering tags?

texts:
In org-mode, I want to make an agenda view showing all notes tagged with "NOTE" or "LOGG". The following code does not produce the result I want:

(setq org-agenda-custom-commands '(("o" "NOTES" tags "+NOTE+LOGG")))

This code will sort out all notes tagged with both NOTE and LOGG.

How can I change my code to filter out notes containing either NOTE or LOGG?


texts:
I'm looking for a way to add a new full-height window split to an existing (splitted) window configuration. Because I don't know how to explain it properly I'll just post some ASCII graphics showing the desired behaviour for two example window configurations:

             from                              to

  +-------------------------+      +---------------------+---+
  |                         |      |                     |   |
  |                         |      |                     |   |
  |            A            |  =>  |           A         | E |
  |                         |      |                     |   |
  |                         |      |                     |   |
  +-------------------------+      +---------------------+---+

  +------------+------------+      +----------+----------+---+
  |            |     B      |      |          |   B      |   |
  |     A      +------------+      |     A    +----------+   |
  |            |     C      |  =>  |          |   C      | E |
  +------------+------------+      +----------+----------+   |
  |            D            |      |          D          |   |
  +-------------------------+      +---------------------+---+

where the function accepts the desired width of the new window E and shrinks the widths of A, B, C, and D accordingly. Edit2: Note that the above two drawings are examples of the expected behaviour for a concrete case. I'm looking for a general function that does this independently of the configuration in the from column (i.e. the number of windows [splits] in the from column should be arbitrary).

I'm also looking for this functionality on the left side and on the top and bottom of a frame.

Edit: From @Nsukami_'s comment I realised that the functionality I'm looking for is a special case of a more abstract problem. So I'll phrase that problem:

  How do you store a window configuration (consisting of any number of windows and buffers) and "paste" the stored config into an existing window?

The "paste" should then preserve relative window sizes and the splitting; naturally the resulting pasted config is a scaled copy.


texts: emacs reftex hangs up while Scanning bibliography database

texts:
I've a strange reftex-issue. When i insert a cite from a bib-file, emacs hangs up. I've tried this on two different machines: Windows 7 and on Mac OS X. (GNU Emacs 24.5.1)

Insert a cite: Open emacs, the bibliography file is loaded with:

(setq reftex-default-bibliography
    '("/Users/user/CloudStation/repositories_d/pandoc-templates/examples/socbib-pandoc.bib"))

(the bib file exists and is accessible)

Open a .tex file and press C-c [ ^M and enter b*.

Now emacs shows the message:

  Scanning bibliography database socbib-pandoc.bib

and HANGS UP. Why?


texts: I want to write a function (or use an existing one) that will take any string and produce a correctly escaped Regex that matches only that string. What is the fastest and simplest way of doing this?


texts:
I have a question regarding connecting to a sql database programmatically. Ideally I would like to have a function with similar functionality to the sql-postgres but instead of interactively prompting me for each part of the connection string, I would just like to programmatically provide all of the arguments.

I seemed to make some progress by setting the defaults the database uses as follows:

    (setq sql-user url-user)
    (setq sql-server "localhost")
    (setq sql-database "myDatabase")
    (setq sql-port db-port)
    (setq sql-password my-password)
    (call-interactively #'sql-postgres)

This gets me 90% the way there. The only thing missing is the prompt still asks me for my password and wont take the default I set. I was looking around for a workaround but I could't seem to figure it out. If there is a better way to go about this problem I would be glad to hear ideas.


texts: How to get an insert-text-button 'action property accessing a dynamically-bound buffer-local variable

texts:
In realgud I have a text button that needs access to a dynamically-bound buffer-local variable.

The situation occurs like this. Inside one buffer that has the buffer local variable, there is a command that creates another "Describe" buffer with the value of that complex defstruct variable formatted nicely using org mode.

But inside that "Describe" buffer I would like to have a button that calls describe-variable on the variable, but have that use the value from its original buffer location, not the value in the describe buffer.

Currently I have inside insert-text-button an action property like this:

'action '(lambda(button) (describe-variable 'realgud-cmdbuf-info))

However this gives picks up the wrong buffer-local value. I can't change the above say to:

'action '(lambda(button) (with-current-buffer buffer (describe-variable 'realgud-cmdbuf-info)))

because of the quote in front of the lambda, and because with-current-buffer is a macro. Changing that to start `list('lambda(button) would be cumbersome if I could figure it out.

Probably I need to use some macro here, but that also is beyond my comprehension.

Help?

`


texts: org-mode how to export raw text no formatting?

texts:
Any quick way to export an org-mode document into a text file with no formatting and no org markup characters?

I am aware of C-c C-e [t] Export to Plain Text unfortunatly those options add formatting to the document

Header 1
═══════════════════════════════════

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.

Header2
────────────────────────────────────────

  ┌────
  │ code block
  └────

The format I'm looking for is:

Header 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.

Header 2

code block


texts: Changing output filename during org-publish

texts:
I would like to change the name of the generated html file of all files during an org-publish.
As per the docs: unless EXPORT_FILE_NAME is set, "Org generates the file name based on the buffer name and the extension based on the back-end format".  I don't want to set EXPORT_FILE_NAME per file however - I'd like to define a function that determines the filename for all files during publish.  (In my case, based on the org file's TITLE property).
For example:

my filename might be 20201003123706-commonspub.org
the file has the #+TITLE property of CommonsPub.
At present my output html file will be called 20201003123706-commonspub.html
But I would like to be CommonsPub.html.

I am publishing via org-publish-project-alist with :publishing-function org-html-publish-to-html.


texts:
I want to copy the name of the symbol at point, without using the mouse.

(global-set-key (kbd "C-s C-c") '<copy_word>)

Possible word marking as i-search does on the following example usage (https://emacs.stackexchange.com/a/55321/18414)

For example: [_id_hello_world] and if cursor is in between hello and world I want to copy complete _id_hello_world.


texts: How do I hide which-func from powerline in 24.5?

texts:
I'm having trouble hiding the display of which-func from powerline. I'm successfully showing it in the header, but it stubbornly won't be removed from powerline. I've tried the following:

(setq mode-line-format (delete (assoc 'which-func-mode
                                      mode-line-format) mode-line-format))

(setq mode-line-misc-info (delete (assoc 'which-func-mode
                                         mode-line-misc-info) mode-line-misc-info)

(setq mode-line-format (assq-delete-all 'which-func-mode mode-line-format))

(setq mode-line-misc-info (assq-delete-all 'which-func-mode mode-line-misc-info))

Also tried the following, hooking into various points around both powerline and which-func:

(powerline-which-func 'which-func nil)
(powerline-raw which-func-format nil 'l)

I've had this working in the past, but no joy this time round.

Halp?


texts:
I defined a polymode with julia-mode as the inner mode. It works well but sometimes syntax highlighting goes wrong and it can be fixed only by restarting emacs. I haven't figured out how I can reproduce it though. When it happens, the inner mode parts are all rendered in the same color, and the color changes by whether the point is in the inner mode or not. I guess something is wrong in my polymode definition but have no idea. What could be the cause of this and how can I debug this sort of situation?

(require 'julia-mode)
(require 'poly-markdown)

(define-innermode poly-julia-markdown-inline-code-innermode poly-markdown-inline-code-innermode
  :mode 'julia-mode
  :head-matcher (cons "^[ \t]*\\(```{?[Jj]ulia.*\n\\)" 1)
  :tail-matcher (cons "^[ \t]*\\(```\\)[ \t]*$" 1)
  :head-mode 'host
  :tail-mode 'host)

(define-polymode poly-markdown+julia-mode poly-markdown-mode :lighter " PM-jmd"
  :innermodes '(poly-julia-markdown-inline-code-innermode))

Nomally working

When broken


texts: Conditional Keybinding for gdb: gud-step if debugging, otherwise gud-run

texts:
I have been trying around getting one keybinding <F7> to perform one gud-step command if a debugging process is running. If it is not running it shall perform gud-run.
I am not very familiar with gdb/gud yet, so while trying to get gdb-running to work as a condition for my defun I am exposed to lisp argument errors, that 2 arguments are required (string-or-char-p and nil), where the first argument is a token, as it seems.
In the end my goal is to use <F7> to invoke a gud-run and to step-through with the same key afterwards, after reaching a breakpoint.

Following snippet is my first attempt. It becomes obvious that gdb-running is missing 2 arguments as aforementioned.

(require 'gud)
(defun my-gud-run-or-step ()
  (interactive)
  (if (gdb-running)
      (gud-step nil)
    (gud-run nil)))

(global-set-key (kbd "<f7>") 'my-gud-run-or-step)


texts: Modify last commit's message and push to upstream

texts:
I'm thinking about automating my following git workflow in emacs:

checkout to a new branch
remove some pattern in the last commit message
commit (amend) it
push it to upstream

How could I automate 4 steps in emacs?

And I've tried to combine step 2 and step 3 into one key in magit by:

(defun magit-commit-append-new-msg ()
  (interactive)
  (let* ((git-dir (magit-toplevel))
    ;; get last commit msg
    ;; TODO handle remote dir
    (msg (shell-command-to-string (format "git -C \"%s\" log -1 --format=\"%%B\"" git-dir)))
    ;; remove changeid and jira line in msg
    (msg-new (concat msg "[MYTEST]")))
    (magit-git-command-topdir (format "git -C \"%s\" commit --amend -m \"%s\"" git-dir msg-new))))

(magit-define-popup-action 'magit-commit-popup
  ?i
  "Commit with new msg"
  'magit-commit-append-new-msg)

But I've not found a way do all 4 steps yet.


texts: How to tangle conditionally based on hostname?

texts:
Why is this block tangled (bar.sh), but not the second (foo.sh)?

#+BEGIN_SRC sh :tangle bar.sh
echo bla
#+END_SRC

bla

#+BEGIN_SRC emacs-lisp :tangle (when (eq system-name 'arch) "foo.sh")
 (princ system-name)
#+END_SRC

arch

According to this excellent 1answer, I should be able to tangle conditionally

Footnotes

1 https://emacs.stackexchange.com/a/14034


texts: How do I make tramp+eshell use my environment customized in the remote ~/.bash_profile

texts:
I have set up custom $PATH in my ~/.bash_profile on a remote machine (for programs installed user-locally by nix and cabal).

I use eshell and tramp to issue commands on the remote machine (cd /remotehost:somedir; then commands). (I chose this method instead of the common SSH-sessions in a terminal primarily because I'm using a bad connection and SSH-sessions get interrupted very often, so I can't count on being able to login, cd, and issue a command before the connection is interrupted.)

Unfortunately, my custom PATH is not honored in this situation, and some of the programs are not found.

What would be the nicest way to solve this problem?


texts: Read-string does not always return a value

texts:
I have written a small function to search MDN docs and display them on the browser.

However, sometimes the function does not work and an empty query is made.

My code is as follows:

(defun search-mdn (&optional querystring)
  (interactive)
  (if (not querystring)
      (search-mdn (read-string "What do you want to look up on MDN? "))
      )
  (let* ( (header "https://developer.mozilla.org/en-US/search?q=")
         (footer "&topic=api&topic=css&topic=canvas&topic=html&topic=http&topic\
=js&topic=mobile&topic=apps&topic=svg&topic=webdev&topic=webext&topic=webgl")
         (searchurl (concat header querystring footer)))
    (browse-url searchurl)
    )
  )

Every time I call the function without parameters (search-mdn (read-string "What ...")) runs, however sometimes it does not call the search-mdn function with   a parameter, although I enter one.


texts:
I'm trying to parse the output of ledger-context-at-point for the account name.  The output looks something like:
  (acct-transaction
   account
   ((indent "   " 238117)
    (status nil nil)
    (account "asset:checking" 238121)))

I want "asset:checking".
I can get it by
(cadr (assq 'account (nth 2

  ;; (ledger-context-at-point)
  (quote
    (acct-transaction
     account
     ((indent "   " 238117)
      (status nil nil)
      (account "asset:checking" 238121)))

  ))))

or by
(cadadr (cdaddr

  ;; (ledger-context-at-point)
  (quote
    (acct-transaction
     account
     ((indent "   " 238117)
      (status nil nil)
      (account "asset:checking" 238121)))

 )))

I would have expected a simple structure, like an alist or plist.  Does this data structure follow a different idiom?  Is there a conventional way to get at the list elements like these?


texts:
How can I implement folding behaviour like a vim?
In vim I has this code:

set foldenable          " enable folding
set foldmethod=indent   " fold sections by indentation
set foldcolumn=1        " display folding column
set foldlevel=0         " first folding level is open

I need close all fold levels 'level by level'. When I unfold some 'folding level', included fold levels must be closed.

Maybe I can implement this with HideShow plugin or another variant?


texts: Which archive did an installed package come from?

texts:
When I use list-packages it shows the archive for packages that are not installed, but not for ones that are. The same for package descriptions. Is there any way to find out which archive an installed package came from?

(Yes, I can search each archive I use, but I was hoping for something quicker & easier.)


texts: How can I capture selected text in a pdf-view buffer with org-capture?

texts:
I would like to capture the selected text (selected with the mouse) in a PDF document (opened in  PDFView Mode) with an org capture template.

When I evaluate the expression (car (pdf-view-active-region-text)) with eval-expression, I can get this highlighted text.

However when I try to use it in a capture template like this:

(setq org-capture-templates
      '(("j" "Notes" entry (file+olp "~/Documents/wiki/Notes.org" "Notes")
         "* %?\n%(car (pdf-view-active-region-text))\n")))

I get:

**
%![Error: (error The region is not active)]

I use the pdf-tools support library.


texts:
I have a next-error-hook to recenter the next-error-last-buffer, so if the buffer is displayed, it will recenter to the line of the error I just jumped to:

(defun jpk/next-error-hook ()
  (let ((win (get-buffer-window next-error-last-buffer))
        (buf (buffer-name next-error-last-buffer))
        (recenter-redisplay nil))
    (when (and win (not (string= "*xref*" buf)))
      (with-selected-window win ;; this is what breaks xref
        (recenter)))))
(add-hook 'next-error-hook #'jpk/next-error-hook)

Lately I've been trying out xref, and it breaks on the with-selected-window (hence the hacky check for the buffer name); I can replace the (recenter) with t and it breaks in the same way.  It seems to only see two matches: the one last clicked on and the next; previous-error and next-error cycle between only these two.  All other modes that work with next-error (grep, compile, ggtags, rg, etc.) do not have this problem.  This also happens with multiple xref backends (elisp, gxref).

How can I write a next-error-hook to recenter the *xref* buffer?


texts: User command to reload file-local variables

texts:
How can I easily reload file-local variables, after I have changes their values in the file buffer?

I know a work around

  Save and close the file and re-open.

But this is pretty cumbersome.


texts: Is there a way to add some margin/padding above a line?

texts:
For example I have this text in a buffer:

aaa
bbb
ccc

and I want it displayed with some spacing above the bbb line:

aaa

bbb
ccc

Is there a face or something which I could add to the bbb line, so it has some margin above it (without modyfing the buffer contents, so not with a newline like here, which I added only for demonstration purposes).


texts: Where do DLLs go for Emacs 24.4.1 on Windows 7?

texts:
I'm getting the message "zlib library not found" when I start emacs and I found that I need to download zlib, which is fine. Then I need to put the DLL somewhere, but I can't find where that should be.

Where do the DLLs that emacs depends on need to go?


texts: org-mode table element selection with blanks

texts:
TL;DR: How do you send a list of elements from a table, including blank cells, to an elisp function?

I have the table below with points on exam questions in columns 2-4. The second row contains the maximum number of points for each question. The student rows contain the actual points received. I want to compute the maximum possible sum for a student, to be updated while I grade the questions.

I have written an elisp function that takes two lists as arguments and does the necessary computations. However, the standard selection argument ignores blank elements. In the function call below, the function will receive the (fontified) lists '("3" "4") '("6" "4" "6") and '("6" "2") '("6" "4" "6"), respectively. I need a selection where each blank element is kept as, e.g., fontified "". Is that possible?

Have tried google and the org manual to no avail.

#+NAME: PTS
|           | Q1| Q2| Q3|     | Max |
|-----------+---+---+---+-----+-----|
|           | 6 | 4 | 6 | Sum | Sum |
|-----------+---+---+---+-----+-----|
| Student 1 | 3 | 4 |   |   7 |  13 |
| Student 2 | 6 |   | 2 |   8 |  12 |
#+TBLFM: @3$6..@>$6='(sum-with-defaults '(@0$2..@0$4) '(@2$2..@2$4)))


texts: Function that returns parent directory absolute path

texts:
(parent-dir "/home/sk/parent/ab.el")

gives

    "/home/sk/parent"

then,

(parent-dir "/home/sk/parent")

gives

"/home/sk"

Any elisp function as parent-dir that gives basepath for both file path & dir path?


texts: How to display file size in the mode line

texts: How can I display file size in MB or KB in the mode line? I have the icon for  encoding setting, title of the buffer, etc but have no file size in there.


texts: How to investigate an emacs crash on linux

texts:
im not very technical and lately i have been getting random crashed the seem to kill emacs and even the emacs daemon. this is an example output from CLI

Fatal error 11: Segmentation fault
Backtrace:
emacs[0x507da9]
emacs[0x4ee96c]
emacs[0x50654e]
emacs[0x506773]
emacs[0x5067df]
/usr/lib/libpthread.so.0(+0x11080)[0x7f8e10656080]
emacs[0x4c5207]
emacs[0x458635]
emacs[0x45d7f2]
emacs[0x41c358]
emacs[0x41e46d]
emacs[0x41fb1a]
emacs[0x421bcd]
emacs[0x454554]
emacs[0x456155]
emacs[0x4d6b71]
emacs[0x4d8625]
emacs[0x4f4c99]
emacs[0x4f5bdd]
emacs[0x5a1f0a]
emacs[0x5a2727]
emacs[0x561d23]
emacs[0x59603b]
emacs[0x561b5b]
emacs[0x59603b]
emacs[0x561b5b]
emacs[0x561e28]
emacs[0x560666]
emacs[0x4ef4d1]
emacs[0x55fef5]
emacs[0x4f3b55]
emacs[0x4fd33b]
emacs[0x5604b2]
emacs[0x4eedec]
emacs[0x560453]
emacs[0x4eeda9]
emacs[0x4f3537]
emacs[0x4f3878]
emacs[0x418a4e]
/usr/lib/libc.so.6(__libc_start_main+0xf1)[0x7f8e102c7291]
emacs[0x4195da]

can anyone guide me on how to further explore this, what should i report and where?


texts:
I am using

(setq a-string "\n* Headline \n body")
(append-to-file a-string nil "~/tmp.org")

to write a string to a org file, since the string contains a *, Emacs ask me to choose which coding system,

Select coding system (default raw-text):

I wonder if there is any way I can remove this prompt and set it to utf-8 automatically?

Example: I get the following message on Emacs

These default coding systems were tried to encode "
* apple
...":

(prefer-utf-8-unix (215 . 4194274) (216 . 4194176) (217 . 4194196)
  (460 . 4194274) (461 . 4194176) (462 . 4194196)) (utf-8-unix (215
  . 4194274) (216 . 4194176) (217 . 4194196) (460 . 4194274) (461
  . 4194176) (462 . 4194196))

However, each of them encountered characters it couldn't encode:

prefer-utf-8-unix cannot encode these: \342 \200 \224 \342 \200 \224

utf-8-unix cannot encode these: \342 \200 \224 \342 \200 \224

Click on a character (or switch to this window by C-x o'
and select the characters by RET) to jump to the place it appears,
whereC-u C-x =' will give information about it.

Select one of the safe coding systems listed below,
or cancel the writing with C-g and edit the buffer
   to remove or modify the problematic characters,
or specify any other coding system (and risk losing
   the problematic characters).

raw-text no-conversion


texts: multi-term: after ssh to a remote server, the prompt messed up

texts: The expected prompt is /home/oracle, but it's something like \342\236\234. What need to do to get it show the right folder name?


texts: How to define additional mode-specific pairs for electric-pair-mode

texts:
electric-pair-mode is a built-in mode for automatically inserting matching pairs of delimiters (parentheses, square brackets, etc.) based on the current major mode.

I know that I can define additional pairs (which will be global) like this:

(push '(?\' . ?\') electric-pair-pairs)      ; Automatically pair single-quotes
(push '(?\' . ?\') electric-pair-text-pairs) ; ... in comments

My question is, how can I define mode-specific pairs (e.g., //, == for org-mode)?


texts: How to implement a nice read-only buffer with accordions and buttons/hyperlinks?

texts:
We would like to devise an Emacs front-end that queries a back-end (generating a list of items in JSON format or so, each with a title, long description, and an URL), and displays this list in a special buffer, with a button to unhide the description, a button to trigger a specific Elisp action, and an hyperlink to browse the URL.

This question only focuses on the front-end part (not the communication with the back-end).

There are multiple modes that are close to this requirement, but each may have pros and cons, just to recapitulate:

goto-address-mode → we could easily apply this mode and make the buffer read-only, but this would just render URLs as clickable hyperlinks (no formatting of the text or choice of the hyperlinks' caption).
org-mode → we could easily generate a .org file and display it in read-only, but (1) the look-and-feel is not that of a browser (e.g., bold text is written *bold*, not bold) and (2) the Org syntax is much more expressive than what would be enough here.
the *GNU Emacs* initial buffer → we could generate a similar buffer with custom text/hyperlinks and the rendering would be much better than the last two solutions (but maybe buttons and accordions are not available).
Custom-mode → displaying the list of items in a buffer similar to M-x customize would be great, as it would have an optimal look-and-feel; but we are unsure if it is feasible to "create a custom Custom-mode buffer" without the "customization" feature (but with actions such as URL opening).

So would you have pointers or suggestions regarding how to generate buffers implementing the solution 4. above?


texts: Advance minibuffer-line to show things on the right site, even if mini-buffer is in use

texts:
I know there is minibuffer-line to display things in the minibuffer if it is not in use. I would like those things to be displayed from the right in the minibuffer, even if it is in use, how would i do that?
Could i possibly split the minibuffer?


texts: resizing frame by window manage under AnyDesk disassociates emacs buffers' dimensions

texts:
I'm trying a new (to me) remote desktop tool AnyDesk (v.5.5.4).  I'm attaching to Ubuntu18 system at work from a Ubuntu19 system at home.  When I resize an emacs frame with the mouse, the menu bar, the mode line and mini-buffer and text area do not resize.

None of the resizing commands I've tried have had any effect.  At root I think it's a failing of AnyDesk but I'm not having any luck at that end and am hoping there's a manual resizing within emacs which might counter the AnyDesk issue.


texts: How to input Chinese on CentOS7 using system input method?

texts:
I would like to be able to type in Chinese. I've tried to set it as system input Chinese (Intelligent Pinyin) without success. I am running Emacs on CentOS7.

I can input Chinese on anywhere except on emacs. For example, I can input Chinese on Gnome-Text-Editor.


texts: After change from Ubuntu to Lubuntu the mouse wheel (scroll) doesn't work without pressing CTRL together

texts:
When I try to scroll with mouse I receive a message saying Wrong type argument: commandp, mouse-5 or Wrong type argument: commandp, mouse-4. This happens after I tried a lot of random fixes. Before the message was something like C-M-) and C-M-( is undefined.

But... If I press CTRL while mouse scrolling, it works fine as expected.

How can I fix that? Thank you.


texts: Mark tasks in org-mode to show up in agenda

texts:
Is there a way to mark tasks in org-mode (similar to how you can mark files in Dired) so that they will show up on an Agenda view or in a sparse tree?

I'm familiar with using TODO keywords. But I was hoping to find something quick and temporary... like a "quick select" mode.

Any ideas?

Thanks!


texts: Is using require multiple times on the same symbol idempotent?

texts:
Is require idempotent? i.e. do

(require 'helm)

and

(require 'helm)
(require 'helm)

end with the same result?


texts:
This might have an obvious answer but I've been trying to fix this issue with no luck. (I'm new to Emacs)

Whenever I start Emacs within a Tmux pane, it ignores some of my .emacs settings. These are the contents of the .emacs file:

(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])
'(cua-mode t nil (cua-base))
'(show-paren-mode t)
'(tool-bar-mode 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.
)

;;Initial GUI frame size and position
(when window-system (set-frame-size (selected-frame) 160 50))

;; Resizing window quick shortcuts
(global-set-key (kbd "S-C-<left>") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-<right>") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-<down>") 'shrink-window)
(global-set-key (kbd "S-C-<up>") 'enlarge-window)

;;Kill buffer without prompt unless there are unsaved changes
(global-set-key (kbd "C-x k") 'kill-this-buffer)

;;Interactively-do-mode, improves file and interface navigation
(require 'ido)
(ido-mode t)

Settings like IDO mode and kill-this-buffer work fine. But the syntax color scheme and S-C-arrows for resizing the window don't work.

Inside Tmux:

Outside Tmux (still in gnome-terminal):

*Also, is running Emacs inside Tmux a bad idea in general?


texts: Is there a way to add a new VC mode for a different tool?

texts: I'm new to this forum and using VC in emacs so if this question has been answered or is just very basic, I apologize. At my employer we use a Version Control system that is not one of the systems supported by emacs. I was hoping there was a way to add a new mode. Presently I have all the commands as aliases in my .cshrc but would like to know if there is a way to integrate the system with emacs.


texts: smartparens does not work well in orgmode

texts:
First, let me say I am new to orgmode and emacs. I am sure I am not providing all the relevant information for the problem, so please let me know what can I add here.

I am using emacs 26.3, and I use spacemacs.

The problem is:

smartparens is not working well in orgmode.
This is what I see when I type the left parenthesis (

When I add a parenthesis after a whitespace) (
When I add a parenthesis with no whitespace()

when I type \( it works well:

When I add \ and parenthesis after a whitespace \(\)

In both cases the tab key does not work to get me out of the parenthesis.

My user-config has this to load smartparens

  ;; smartparens
  (with-eval-after-load 'smartparens
    (sp-with-modes 'org-mode
      (sp-local-pair "$" "$")
      (sp-local-pair "" "" :actions '(rem))
      (sp-local-pair "=" "=" :actions '(rem))
      (sp-local-pair "" "" :actions '(rem))
      (sp-local-pair "\\left(" "\\right)" :trigger "\\l(" :post-handlers '(sp-latex-insert-spaces-inside-pair))
      (sp-local-pair "\\left[" "\\right]" :trigger "\\l[" :post-handlers '(sp-latex-insert-spaces-inside-pair))
      (sp-local-pair "\\left\\{" "\\right\\}" :trigger "\\l{" :post-handlers '(sp-latex-insert-spaces-inside-pair))
      (sp-local-pair "\\left|" "\\right|" :trigger "\\l|" :post-handlers '(sp-latex-insert-spaces-inside-pair))
      (sp-local-pair "(" ")")
      (sp-local-pair "\\(" "\\)")
      (sp-local-pair "\\[" "\\]")))

  (add-hook 'org-mode-hook 'smartparens-mode)


texts:
Is it possible/easy to add custom markers for the start/end of indentation blocks in c++-mode?

I'd like the indentation of a block of code like

BOOST_AUTO_TEST_SUITE(SuiteName)
// <<TestCases>>
BOOST_AUTO_TEST_SUITE_END()

to end up as

BOOST_AUTO_TEST_SUITE(SuiteName)
  // <<TestCases>>
BOOST_AUTO_TEST_SUITE_END()

by treating the BOOST_AUTO_TEST_SUITE/BOOST_AUTO_TEST_SUITE_END strings as braces.

Is there a pre-canned way of doing this?

Andy.


texts: Where is emacs powershell getting this PATH variable from?

texts:
When I execute the command $env:path to get the path variable in the powershell mode in spacemacs I get the following:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Windows\System32\OpenSSH\;
C:\ProgramData\chocolatey\bin;
C:\Program Files\Git\cmd;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files\PuTTY\;
C:\Users\Oliver Marshall\AppData\Local\Microsoft\WindowsApps;

Which only partly matches the System Environment Variable:

C:\Program Files\ImageMagick-7.0.8-Q16;
C:\Python37\Scripts\;
C:\Python37\;
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Windows\System32\OpenSSH\;
C:\ProgramData\chocolatey\bin;
C:\Program Files\Git\cmd;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\Program Files\PuTTY\;
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;

And doesn't match the User Environment Variable either:

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
C:\Python37;
C:\Python37\Scripts;
C:\Users\Oliver Marshall\AppData\Roaming\Python\Python37\Scripts;
C:\tools\msys64;
C:\Program Files\MiKTeX 2.9\miktex\bin\x64;

What's weird is that the exec-path variable shows what I'd consider to be the correct result:

c:/Program Files/ImageMagick-7.0.8-Q16
C:/Python37/Scripts/
C:/Python37/
C:/Program Files (x86)/Common Files/Oracle/Java/javapath
C:/Windows/system32
C:/Windows
C:/Windows/System32/Wbem
C:/Windows/System32/WindowsPowerShell/v1.0/
C:/Windows/System32/OpenSSH/
C:/ProgramData/chocolatey/bin
C:/Program Files/Git/cmd
C:/Program Files (x86)/NVIDIA Corporation/PhysX/Common
C:/Program Files/PuTTY/
C:/Program Files/MiKTeX 2.9/miktex/bin/x64/
C:/Users/Oliver Marshall/AppData/Local/Microsoft/WindowsApps
C:/Python37
C:/Python37/Scripts
C:/Users/Oliver Marshall/AppData/Roaming/Python/Python37/Scripts
C:/tools/msys64
C:/Program Files/MiKTeX 2.9/miktex/bin/x64
c:/ProgramData/chocolatey/lib/Emacs/tools/emacs/libexec/emacs/26.1/x86_64-w64-mingw32
C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath
C:\\Windows\\system32
C:\\Windows
C:\\Windows\\System32\\Wbem
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\
C:\\Windows\\System32\\OpenSSH\\
C:\\ProgramData\\chocolatey\\bin
C:\\Program Files\\Git\\cmd
C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common
C:\\Program Files\\PuTTY\\
C:\\Users\\Oliver Marshall\\AppData\\Local\\Microsoft\\WindowsApps

Why is powershell getting this malformed path variable?

This has also affected the building of LaTeX documents as it says it can't find the pdflatex executable but I've included the MiKTeX installation in the environment variable and executable-find finds the executable just fine.


texts: How to copy the content of the source block at point to the kill ring?

texts:
Suppose you're in org mode and working with source code.
Your point is currently inside a source block at some random position.
Is there an easy way to copy the body of source block (excluding #+begin_src <header args> and #+end_src)?
I was thinking of an automated, quick solution, like using a function.
The manual way for me to do this is to use mark-paragraph and then kill-ring-save.
But the latter unfortunately includes the last line of the source block, the #+end_src line.
I've played around with universal arguments -1 before mark-paragraph, but I couldn't manage to exclude the last line (#+end_src).


texts: AUCTeX does not compile if the local variable is already set

texts:
I'm basically want to ask the question that was asked in Tex Stackexchange but was considered off-topic there (this is the link to the question).

When I am trying to compile (using the command C-c C-c or C-c C-a)
 a latex document which already has the needed local variables to point to the master-file like lines below at the end:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

or if the master-file is another file:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "fileNameOfMasterFile"
%%% End:

it does not compile and instead, just shows the following messageMaster file already set in the mini buffer.

If I simply delete the local variable %%% TeX-master: "fileNameOfMasterFile" or %%% TeX-master: t and try to compile again (using the command C-c C-c or C-c C-a) it asks for the master-file and compiles as usual. Further on, it works normally when I compile again. But if I simply close the buffer and (re-)open the file again I face the same issue.

Is it a natural behavior? If not, any idea why this happens and how I can solve it?

If needed, I have the following in my init file:

(setq-default TeX-master nil)

Add-on: I'm suspicious that this might be related to AUCTeX version. What I just explained in the question was tested on AUCTeXversion 12.2.0 and I tried with a similar setting (same init file but an older emacs) with an older version AUCTeX (12.1.2)(on a different machine) and it works as it is expected.


texts: While merging, how to tell Magit to use one version of the file?

texts: When I merge something and there are conflicts, I can go to the file in the magit status page (SPC-g-s) and press, for example, e to start ediff. Within that, I can scroll through all conflicts and press either a or b to tell it, which version to use (my local version or the external version). How can I do that for all conflicts at once? Sometimes, I don't want to go through all conflicts because sometimes I know that all of them should resolve the same way. I can't find out how to do that.


texts: How do I checkout a file from another commit in Magit

texts:
I've got a file foo.txt in branch A, and I want to check out foo.txt from branch B into the index.  On the command line, I would do this:

$ git checkout B -- foo.txt

I want to be able to do this in magit by going to log, finding the commit I'm interested in (e.g l o B),  finding foo.txt, and running some command, but I can't figure out how to do it.


texts: org-mode "prettifies" URL links, but not file links

texts:
The org-mode documentation says that

  Once a link in the buffer is complete, with all brackets present, Org changes the display so that ‘DESCRIPTION’ is displayed instead of ‘[[LINK][DESCRIPTION]]’ and ‘LINK’ is displayed instead of ‘[[LINK]]’.

If I type

[[https://www.calebjay.com][website]]

When I finish the final bracket and press SPC, indeed the links shortens to only show the word website. This is what I want.

However, if I type

[[file:test.org][test]]

This does not shorten. It always displays in the raw as above. If I put my cursor over test and press ENTER, a new window opens with that (existent) file opened.

How can I make the file link behavior mirror that of a website?

EDIT: I highlighted an entire link and ran font-lock-studio-region, which output a 200 line file. One thing I noticed is a line that says

org-activate-links
  (0 nil)

I wonder if that has something to do with it. The whole file can be found at https://pastebin.com/REzWfG53

My versions:

GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-09-16

Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /home/caleb/.emacs.d/elpa/org-plus-contrib-20191230/)

Ubuntu 18.04.04 64bit


texts: compiling bibliography doesn't work with emacs (missing file *.bbl and its log file *.blg). Works on command line

texts:
without emacs

i have this doc.tex file:

\documentclass{article}
\usepackage{fontspec}
\usepackage[backend=biber]{biblatex}
\usepackage{csquotes}

\title{}
\date{}
\author{}
\bibliography{bibliography}

\begin{document}
\maketitle
\thispagestyle{empty} % has to be after  \maketitle

testing bibliography ---> \autocite{test:test}

\printbibliography
\end{document}

and this bibliography.bib file:

@book{test:test,
  title = {test},
}

which both compiles to the desired pdf file (with the desired printed bibliography):

$ xelatex doc.tex && biber doc && xelatex doc.tex

with emacs

however, if i use GNU Emacs 25.1.1 and  auctex-11.89.4 for that, it doesn't work:

i think this is the important part of the log file (i can't upload the full log file, due to the character limitation on stackexchange.com):

Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file 'doc.bbl' not found.

No file doc.bbl.
Package biblatex Info: Reference section=0 on input line 11.
Package biblatex Info: Reference segment=0 on input line 11.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <12> on input line 12.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 12.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 12.

LaTeX Warning: Citation 'test:test' on page 1 undefined on input line 15.

LaTeX Warning: Empty bibliography on input line 17.

[1

] (./doc.aux)

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                doc
(biblatex)                and rerun LaTeX afterwards.

Package logreq Info: Writing requests to 'doc.run.xml'.
\openout1 = `doc.run.xml'.

 )

But unfortunately, i don't know what causes these errors. (in particular file 'doc.bbl' not found)

what have i tried?

Reading this tex.stackexchange.com question, some solutions are given.

reinstalling emacs and auctex

doesn't change anything.

reading a different log file (.blg)

unfortunately, no file with the extension .blg is given after building with emacs.

EDIT
my emacs auctex settings:

(with-eval-after-load 'tex
    (setq LaTeX-item-indent -2 LaTeX-indent-level 4)
    (setq-default TeX-master nil)
    (setq TeX-parse-self t)
    (setq TeX-auto-save t)
    (add-hook 'LaTeX-mode-hook 'visual-line-mode)
    (add-hook 'LaTeX-mode-hook 'flyspell-mode)
    (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
    (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
    (setq reftex-plug-into-AUCTeX t)
    (setq-default TeX-engine 'xetex)
    (setq LaTeX-biblatex-use-Biber t)
    (setq-default TeX-PDF-mode t))


texts:
How would you export org headers verbatim to HTML?

My org file looks like this:

#+TITLE: my-org-file.org

An example of org-style headers:

#+begin_example
* Title1
** Subtitle1a
** Subtitle1b
* Title2
** Subtitle2a
#+end_example

The expected output when exporting to HTML (org-export-dispatch; C-c C-e h o) is:

my-org-file.org

An example of org-style headers:

* Title1
** Subtitle1a
** Subtitle1b
* Title2
** Subtitle2a

The actual output is:

my-org-file.org

An example of org-style headers:#+beginexample

1 Title1
1.1 Subtitle1a
1.2 Subtitle1b
2 Title2
2.1 Subtitle2a

#+endexample

I have tried the other export options (export ascii, quote, verse, html export) and each produces the same result.


texts:
For a while, I've been getting the message

Package menu: Operationfinished. 1 package no longer needed, type 'M-x package-autoremove' to remove them

The package is org-bullets, very spread package through the community (it's what I've seen)... So, I thought that (perhaps) it was included into the org-plus-contrib branch (or even the org itself). Thus, I ran the command!... and the bullets were gone!!!

Of course, I installed the package again and problem solved, but everytime I update or install a package I'm getting the same message over and over.

Can someone explain me what happen to org-bullets? And whether I can get rid off the message (without dropping the package) or not?


texts: Open file from dired in the same window -- using the mouse

texts:
How do you configure emacs to open a file in the current window -- using the mouse -- when it is selected from a dired buffer?

That is, when I open a directory and then select a file with the mouse I want the file displayed in the same window which displayed the dired buffer.


texts: How to create a helm source from a list of points?

texts:
I have a list of lines in my current buffer, and I'd like to create a helm menu
for the user to select which point to navigate to. Ideally, I'd like a helm
source like helm-swoop's, but all the lines are load from my list of line
numbers rather than the entire buffer.


texts: All of a sudden i started seeing an insertion of a period after two spaces, even in programming mode files

texts:
I started noticing this after an update, every two spaces at end of a word/symbol places a period at the end.
I am not sure how to debug this or where to look.

any pointers appreciated.


texts: "error in process sentinel: not enough arguments for format string” with simple R code

texts:
Flymake started giving this warning today:

Error in process sentinel not enough arguments for format string

The mode line shows Flymake:Wait [0 0]. I narrowed down the code throwing the error to a few lines:

context("German Statlog credit dataset")
library("PosteriorBootstrap")

test_that("German Statlog data outcomes are in {1, 2}", {
  raw_dataset <- as.matrix(utils::read.table(get_german_credit_file()))
  expect_true(all(raw_dataset[, ncol(raw_dataset)] %in% c(1, 2)))
})

Following this thread, I enabled debugging with M-x toggle-debug-on-error, which shows the stack trace:

Debugger entered--Lisp error: (error "Not enough arguments for format string")
  format-message(" Error in cat(\"@@warning: @@\", e) : \n  argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") :\n  cannot open file 'context(\"German Statlog credit dataset\")\nlibrary(\"PosteriorBootstrap\")\n\ntest_that(\"German Statlog data outcomes are in {1, 2}\", {\n  raw_dataset <- as.matrix(utils::read.table(get_german_credit_file()))\n  expect_true(all(raw_dataset[, ncol(raw_dataset)] %in% c(1, 2)))\n})\n\n': File name too long\nExecution halted\n")
  apply(format-message " Error in cat(\"@@warning: @@\", e) : \n  argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") :\n  cannot open file 'context(\"German Statlog credit dataset\")\nlibrary(\"PosteriorBootstrap\")\n\ntest_that(\"German Statlog data outcomes are in {1, 2}\", {\n  raw_dataset <- as.matrix(utils::read.table(get_german_credit_file()))\n  expect_true(all(raw_dataset[, ncol(raw_dataset)] %in% c(1, 2)))\n})\n\n': File name too long\nExecution halted\n" nil)
  flymake--log-1(:warning ess-r-flymake " Error in cat(\"@@warning: @@\", e) : \n  argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") :\n  cannot open file 'context(\"German Statlog credit dataset\")\nlibrary(\"PosteriorBootstrap\")\n\ntest_that(\"German Statlog data outcomes are in {1, 2}\", {\n  raw_dataset <- as.matrix(utils::read.table(get_german_credit_file()))\n  expect_true(all(raw_dataset[, ncol(raw_dataset)] %in% c(1, 2)))\n})\n\n': File name too long\nExecution halted\n")
  ess-r--flymake-check-errors()
  ess-r--flymake-parse-output(#<buffer  *ess-r-flymake*> #<buffer test_sample_data.R> #f(compiled-function (&rest args) #<bytecode 0x40791b4d>))
  #f(compiled-function (proc event) #<bytecode 0x40791b61>)(#<process ess-r-flymake> "exited abnormally with code 1\n")


texts: I'm trying to use counsel/ivy to insert org links, but I haven't found a way to do this. I just want something to replace org-insert-link with a counsel interface. Can anyone help?


texts: How to achieve automatic, relative re-scheduling of child tasks after TODO state change?

texts:
I would like to do something in Org-Mode, but I'm not sure how to achieve it in the best way.
I basically want to be able to have an item in my agenda every few days that reminds me every few days to work on a personal project. The reminder should reflect the current sub-task. I don't want to be pressured by fixed deadlines (weekly or daily).
How can I do this?
What I have
Let's say I would like to do something that involves multiple small steps. Naturally I would break it down like this:
** TODO Work through the book Practical Common Lisp
*** TODO Read chapter 1 of PCL
*** TODO Read chapter 2 of PCL
*** TODO Read chapter 3 of PCL
...

I use book chapters as an example, but I would use this for other, more abstract tasks, too.
What I want (I guess)
I would like to have an entry in my agenda that reminds me to do this. More specifically it would be nice, if the following things were true:

There is only one entry in the agenda (i.e. not all children).
The entry in the agenda changes (i.e. not the parent item).
When one sub-task is set to DONE, it takes a (configurable) number of days until the next item is shown in the agenda.

I am imagining (3) similar to how ".+5d" in a SCHEDULED timestamp would repeat a TODO five days from today.
The problem
At the moment to me it seems I can always only have only two of the three points above. I can set a repeating timestamp on the parent heading, but that will always only show the general heading, not the particular task. Relative rescheduling (or repeating) for child tasks does not make sense, but I also don't want fixed deadlines here.
Thoughts on a solution
I haven't used Org Mode's habits feature, but it seems related. Also I considered using TODO dependencies as suggested in this answer, maybe org-depend, or something using a single NEXT for only one child heading. However, right now I can't see how the relative scheduling of child headings could work in both cases. There is a similar question with the suggestion to use org-clone-subtree-with-time-shift, but I don't want copies, I already have them.
I'm about to cook something up in Elisp (I am learning since the summer). However this problem seems really not that uncommon, so I wondered whether somebody knows better existing solutions. I'm also open to completely quite other suggestions that achieve the same thing, in case I'm missing something obvious. I want to keep task and sub-tasks represented as Org Mode's parent and child headings.
Edit: Current workaround
My current workaround is a list of checkboxes ("- [ ] ...") under a parent heading that contains a cookie (e.g. "[5/12]") and a file: link. The link points to the same file and contains a regex that matches the first unchecked checkbox with some arbitrary keyword, which I've appended to checkbox line. While this approach allows me to quickly jump to the next item, the item is not shown in the agenda.
In case somebody is interested, the link looks like the following. I somehow wasn't able to figure out quickly how to escape [ and ], so I used a dirty . instead (enough for me in this case).
file:~/doc/org/inbox.org::/^- . . .* #offload$/


texts: How to create a function to lauch org-capture with a selected template?

texts:
Let's say my capture template is bound to 't':
(defun my/captureTemplate ()
(interactive)
(org-capture "r")

This won't work as it will show me the whole list of potential templates to choose from. Thanks!


texts: Open a frame for the first time (using `emacsclient -c`) showing other buffer than *scratch*

texts:
I have emacs configured to start org-agenda automatically and show it instead of *scratch*. Like this:

(add-hook (quote after-init-hook)
              (lambda ()
              ;; ...
              (org-agenda-list 1)
              (delete-other-windows)))

However, the same trick don't works with emacsclient, the org-agenda buffer is there in the buffer list, but the *scratch* buffer is shown instead.


texts: Flagging or auto-correcting self-referential 'let' expressions

texts:
How do you catch the lisp programmer's error:

  "I typed let, but I really meant let* and wasted five to ten seconds for the nth time today!"

I make this mistake all the time.  Usually in a hurry or not anticipating the dependence of symbols I'm declaring I'll write:

(let ((foo-bar 42)
      (baz-bat (* foo-bar 2))
  (message "I bet you forgot something!"))

Resulting in the irritation in realizing that I miskeyed let* yet again.

Lisp error: (void-variable foo-bar)


texts: orgmode - remove table header row bold style from html export

texts:
Below org code will bold the header row. how to remove it?

#+ATTR_HTML: :border 2 :rules all :frame border :class striped table-striped
|---+---|
| A | B |
|---+---|
| C | D |
|---+---|

Current output (A and B is in bold style):


texts:
From the documentation of insert-char, I cannot see why

(insert-char "GREEK SMALL LETTER EPSILON")

doesn't work.  Is there a non-interactive way to insert a character
given its Unicode name?


texts: increasing the time of search-forward using sumatra-forward.el

texts:
sumatra-forward.el
allows to do a forward-search from a place in a tex file to the corresponding place in its compiled pdf file viewed by SumatraPDF. The command to do the job is M-x sumatra-jump-to-line. After invoking this command, the corresponding place in pdf file takes the red color for few millisecond. Is it possible to increase this really brief time?


texts: What's a good way to run a command instead of opening a file?

texts:
I have this code to play mp3 files instead of opening them:

(defun ora-mp3 ()
  (interactive)
  (let ((file (buffer-file-name)))
    (kill-buffer (current-buffer))
    (ora-dired-start-process (format "rhythmbox \"%s\"" file))))
(add-to-list 'auto-mode-alist '("\\.mp3\\'" . ora-mp3))

Here ora-dired-start-process is just a variant of shell-command.

I kind of like using auto-mode-alist, since it's very granular: only
mp3 files are affected. But the problem is that my window
configuration gets messed up each time ora-mp3 is called.

How could I avoid the problem with the current approach? Or maybe
there's another approach that doesn't have this problem?


texts:
I would like to be able to link specific figures from other documents. Basically the function of the xr package in LaTeX where it doesn't necessarily give you an actual link that will take you outside of the document but just takes care of printing the correct figure label automatically.

For example I have my main manuscript.org and a supplemental_info.org and I reference the figures in supplemental_info.org in the manuscript.org. I define all of them like:

#+NAME: fig:my-fig
[[./figures/figure.pdf]]

I tried referencing them using [[file:supplemental_info.org::fig:my-fig]] which didn't work.

I also can't use the xr package directly (i.e. \ref{fig:my-fig}) because org-mode mangles the labels when it exports!

So is there a way to do this prescribed by org-mode?

Alternatively, is there a way to force org-mode to export the #+NAME: values as the label values?


texts: Is there a way to "end" an org tree so that the text afterwards is at the top level?

texts:
Sometimes, I'd like to have a way to indicate that an org tree has an "end" and then be able to return to the top level. I.e. I'd like the document to look like this:

* headline

  some text here

  more text

  END-OUTLINE

Text here is at the top-level and is not indented.

* another headline

  text

  END-OUTLINE

More top-level text.

Is there a good way to do this?


texts: How to preserve emacs key bindings when changing keyboard layout?

texts:
Imagine that you change your keyboard layout. You have to spend time training your muscles to find the keys that you want to type, this is already hard enough.

But you will also have to spend time training your muscles to find the keys that you want to enter as part of shortcuts, which is ridiculous (you have usually chosen these keys because they are easy to reach, not because of their letter*).

Is there a way to have these key definitions not move around when you change your keyboard layout?

For example if I'm in azerty, and I want to learn qwerty, I would like to have beginning-of-line remapped from C-a to C-q, so that it stays where it is on my keyboard (first key right of TAB).

As I understand it, it is partially implemented through input methods, but it takes the opposite way: it changes the way emacs interprets input characters for text. But it won't work if you want to change your keyboard layout system-wide, for example.

I understand that there are lots of ways to define key bindings, but for example, I would deem acceptable a solution that would take care of all key bindings converted from human strings with the kbd function.

*. It is not true for certain keys that are less often used. For example, the C-c map of most major modes use key names that are easy to remember, rather than easy to reach. As a bonus question, it would be nice to be able to preserve (remap so that the physical key doesn't move) some keybindings and move (don't remap, the letter associated to the key doesn't change) some others. The user could select one option or the other by using two different functions instead of kbd when defining his keybindings.


texts: How to unbind the key for a specific map?

texts:
I use org, smartparens and use-package altogether. Sometimes I need to delete a heading and its subheadings. Without smartparens package I use the C-k key and it allows me to delete the heading itself and all the nested text too.
But when I activate smartparens-global-strict-mode the C-k key binds to the sp-kill-hybrid-sexp function. After that calling C-k deletes only the first line and leaves all the nested text.
I tried to unbind it, but it didn't work.
(use-package
  smartparens
  :custom (smartparens-global-mode t)
  (smartparens-global-strict-mode t)
  :bind (("C-c s a" . sp-beginning-of-sexp)
         ("C-c s e" . sp-end-of-sexp)
         :map smartparens-strict-mode-map
         ("C-k" . nil)))

Therefore, I ask you to guide me on how to unbind the key for a specific map?


texts: Is there a way to highlight symlinks in the speedbar?

texts: I would like files in the speedbar that are symlinks, to be highlighted, or at least marked with @ so that they are easily distinguishable.


texts: Create a google calendar event from natural text

texts:
I receive many emails that have some events in them which I currently have to enter manually into my Google calendar. It would be great if I can automate this process as much as possible using some sort of natural language processing (or a very long list of regex's).

I would like to know if there are any solutions out there, especially in Emacs, before I start writing my own.

If there are no ready solutions, do you have any advice you can give me to implement the solution?

For example, based on this article, I was thinking using OpenNLP would be a good idea.


texts: Origin of some modeline indications: Git:master [i,#]

texts:
In my mode line, to the left of where it describes the current modes e.g. (Org company), there is text that looks like [#] or sometimes [i,#], where the i and # signs are highlighted. I don't think this is a stock Emacs feature as I can't find what it means in the documentation. What does that mean?

To the left of the above, the mode line mentions Git:master. I have not installed any Git-related packages. Further, when I look at the currently running modes, I do not see anything that mentions Git or version control. I also do not see in the manual anything that mentions out-of-the-box Git integration. I'm wondering what I might have done to enable this.


texts: headings in org-mode: unexpected behavior

texts:
Recently, I started experiencing unexpected behavior when editing org-mode files.
Suppose I have two headings, with _ indicating the cursor position.
* Heading
*_
** Subheading

I want to insert a new subheading before the existing one.  So I now press * to get a second asterisk.  But I don't get a second *.  Instead, one of the asterisks from the existing subheading on the line below disappears!  Then I press * again, and now the asterisk reappears!  Now I press * for a third time, and I finally get the second asterisk on the new heading that I want to insert.  So I press space to give it a title, only to find that I now have four asterisks!  Like this:
* Heading
**** _
** Subheading

I find this behavior extremely annoying and have no idea how it is supposed to be helpful or what purpose it serves.  I don't think I changed anything in my setup, so it might have been enabled by an update.  I want to turn it off, but I can't find the relevant variable (meaning I don't even know what to search for).  Does anyone know how to turn this "feature" off?


texts:
I recently downloaded Emacs 24.4 and sometimes I see an "invalid date" error in my buffer.

When I am in eww, often I try to click (RET) a link and I get:

error in process sentinel: Invalid date: 01-Jan-2055 00:00:00.00 GMT

I thought it was an eww error, but today I was in c-mode and I saw

Error running timer `url-cookie-write-file': (error "Invalid date: 01-Jan-2055 00:00:00.00 GMT")

How can I fix this? I've not found any useful post with an "invalid date".
Thanks!


texts:
I want to change an active date <2017-12-10 17:04> to inactive date [2017-12-10 17:04] and vice versa.

How do I do that?


texts: how to view and edit content-only of all headers in org buffer

texts:
I would like to edit an org buffer by making visible only the content under headers while collapsing/hiding the headings and property drawers. This "content-only" view is sort of the inverse of regular org-cycling where one folds/hides the content and views only headers. Regular org-cycling is useful to get a birds-eye view of hierarchy of a long document. The view I am proposing presents the text content so that one can gauge the flow of the text itself. Below is an example of an org buffer and what I imagine the content-only view might look like.
I am aware that org-export has a feature to ignore headings (ignore in org-extra). I am looking for a content-only view without exporting — "live" in the org buffer itself.
For those familiar with Scrivener, my request is like scrivenings view.
Another thread speaks to narrowing the view to content-only of the current header — not quite what I'm looking for. I'd like to see content-only of all headers in the buffer.
Example
org buffer
** example org text
:PROPERTIES:
:CREATED:  [2021-05-09 Sun 08:04]
:END:
I have narrowed my buffer to this entry.

*** an entry

I have some text here.

**** A subheading follows
:PROPERTIES:
:CREATED:  [2021-05-09 Sun 07:59]
:END:

Some text in a subheading.

**** TODO consider future features
:PROPERTIES:
:CREATED:  [2021-05-09 Sun 08:01]
:END:
If there is text here, include it... in a more sophisticated version, one could imagine this being an option to toggle whether text under a TODO header should or should not appear.

*** Another entry
:PROPERTIES:
:CREATED:  [2021-05-09 Sun 07:59]
:END:
Under a second major topic, I have written more.

Expected content-only view

...

I have narrowed my buffer to this entry.

...

I have some text here.

...

Some text in a subheading.

...

If there is text here, include it... in a more sophisticated version, one could imagine this being an option to toggle whether text under a TODO header should or should not appear.

...

Under a second major topic, I have written more.


texts:
I use emacs-26.1 org-version 9.1.14.

My templates (list) is showing up but when I choose a template I get:

org-capture: Capture abort: (void-function org-eldoc-load)

I can't find org-eldoc.el in my org installation.


texts: specify predicate in safe-local-variable-values

texts:
I am trying to configure safe-local-variable-values in my init.el so that all string values for projectile-project-name in any .dir-locals.el file are considered safe.
(custom-set-variables
  '(safe-local-variable-values
    '((projectile-project-name . #'stringp)))

What is the correct syntax?


texts: CUSTOM_ID for HTML breaks "next line" in LaTeX

texts:
If in Org, I have

**** Scancode
:PROPERTIES:
:CUSTOM_ID: input-types-scancode
:END:

   Representing a Scancode is simple.

the ID properly gets set in HTML:

Scancode

Representing a Scancode is simple.

But the LaTeX breaks:

\begin{enumerate}
\item Scancode
\label{sec:org0a033f2}
Representing a Scancode is simple.

However, if I add a newline in the Org:

**** Scancode

:PROPERTIES:
:CUSTOM_ID: input-types-scancode
:END:

   Representing a Scancode is simple.

it fixes the LaTeX:

\begin{enumerate}
\item Scancode
\label{sec:org9bf670a}

Representing a Scancode is simple.

but breaks the ID in the HTML:

Scancode

Representing a Scancode is simple.

How can I keep the ID in HTML while keeping the content of the LaTeX entry on the next line?

My #+OPTIONS: are

#+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline
#+OPTIONS: author:t broken-links:nil c:nil creator:nil
#+OPTIONS: d:nil date:t e:t email:nil f:t html-style:nil
#+OPTIONS: inline:t num:t p:nil pri:nil prop:nil stat:t tags:t
#+OPTIONS: tasks:t tex:t timestamp:t title:t toc:t todo:t |:t


texts:
While in web-mode, when I type {{ emacs will add }} to the end, and when I press SPC it will then add another }} to the end with a space either side and one extra space to the right, so it looks like this {{ |  }}}}. Apparently there are two commands that are working together to "help" me, I want to disable one of them.
I am trying to find the source of the problem, so is there a way I can view the commands that caused this issue so I can fix it myself?
I am using Doom Emacs


texts:
I love that I can quickly capture ideas with org-capture. For my academic writing, these get sent to a scientific_journal.org file. After a while though, I find that I have many related post, scattered throughout, which need to get grouped under a common heading or sent off into a separate document.

What I would like to do is search my capture document with helm and mark all the relevant candidates, then [TAB] to a helm action that lets me batch refile these at once.

I found some discussion of this earlier here and here. And John Kitchin has some code to get this done outside of helm:

http://lists.gnu.org/archive/html/emacs-orgmode/2017-04/msg00056.html

and he also posted some code to bulk-apply actions in helm:

http://kitchingroup.cheme.cmu.edu/blog/2015/01/24/Anatomy-of-a-helm-source/

But, as someone who is relatively new to helm, I'm having trouble piecing the two bits together...

Any ideas?

Thanks!