texts: What is the `'inf-template` file in the ob-template.el file (template for creating new babel language)

texts:
Because the options provided by the mathematica.el file in org-contrib are quite limited, I am trying to create a new, extended, mathematica.el file. As explained on the org language development page, I start out with the ob-template.el file. However, the template file expects an inf-template file  (all occurences of template should be substituted by the target language, but I keep things general here) on linenumber 71 in the org-babel-expand-body function but I have no idea what kind of file that should be. Also I can not find any other inf-... file on my system. As I don't know much about inf files my general question is:

Someone here can share some useful information about inf-... files?


texts: how can i thoroughly change (key "C-x") in ivy-minibuffer-map?

texts:
one thing very interesting,
i tried to

(define-key ivy-minibuffer-map (kbd "C-x") 'ivy-kill-line)

..well
then i restart my emacs,
the first time i use the ivy to complete something,
i type C-x indeed can kill the line,

but ,the second time i use the ivy, the C-x became a suffix.
what the fuxk... then i tried which-key-mode,
i found these keys on suffix of C-x in ivy-minibuffer

C-x 8(iso-transl-ctl-8-map) -> (many strange chars inside..)
C-x @  -> (S -> event-apply-shift-modifier)(h -> event-apply-hyper-modifier)....etc something like this
C-x r -> (some functions on rectangle..)

but i never defined them...
what the fuxk...

anyone can help me out..
i just want to use C-x in ivy-minibuffer-map to kill the line.

btw, i tried this, doesnt work.

(defvar ivy-minibuffer-map (let ((map (make-sparse-keymap)))define xxxxx)

emmm.i think maybe this is caused by some other minor modes.
emmmm. confused.


texts:
So I've recently come back to working with emacs again I mostly write JavaScript in particular React these days and I'm noticing some strange behaviour when trying to indent my code.

it seems the indentation will only work for the first couple of times and then everything after a certain point has to be on the same indent. For example:

import React from 'react';

const About = () => {
  return (

  );
}

export default About;

You will notice that the react component above that the header div is indented to the same level as the about container. but all other indentation is fine. If I try to add any further elements in the header or anywhere else in the container the indentation remains the same too.

Here is my .emacs (apologies for the mess):

;; Include MELPA packages
(when (>= emacs-major-version 24)
  (require 'package)
  (package-initialize)
  (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
  )

;; KEY MODIFIERS
(global-set-key (kbd "M-3") '(lambda () (interactive) (insert "#")))
(defalias 'yes-or-no-p 'y-or-n-p)

;; YASNIPPET
(require 'yasnippet)
(yas-global-mode 1)

;; IDO MODE
(ido-mode 1)
(setq ido-file-extensions-order '(".js" ".json" ".scss" ".html" ".css"  ".yml"  ".rb"))
(setq ido-create-new-buffer 'always)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)

;; THEME
;; (load-theme 'tsdh-dark)

;; WEB MODE
(setq-default indent-tabs-mode nil)
(defun my-web-mode-hook ()
  "Hooks for Web mode."
  (setq web-mode-markup-indent-offset 2)
  (setq web-mode-css-indent-offset 2)
  (setq web-mode-code-indent-offset 2)
)

(add-hook 'web-mode-hook  'my-web-mode-hook)
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.scss\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.css\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.json\\'" . json-mode))

;; No more backup files
(setq make-backup-files nil)

;; FLYCHECK
(require 'flycheck)

;; turn on flychecking globally
(add-hook 'after-init-hook #'global-flycheck-mode)

;; disable jshint since we prefer eslint checking
(setq-default flycheck-disabled-checkers
  (append flycheck-disabled-checkers
    '(javascript-jshint)))

;; use eslint with web-mode for jsx files
(flycheck-add-mode 'javascript-eslint 'web-mode)

;; customize flycheck temp file prefix
(setq-default flycheck-temp-prefix ".flycheck")

;; disable json-jsonlist checking for json files
(setq-default flycheck-disabled-checkers
  (append flycheck-disabled-checkers
    '(json-jsonlist)))

;; https://github.com/purcell/exec-path-from-shell
;; only need exec-path-from-shell on OSX
;; this hopefully sets up path and other vars better
(when (memq window-system '(mac ns))
  (exec-path-from-shell-initialize))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   '(yasnippet exec-path-from-shell web-mode flycheck darkmine-theme json-mode js3-mode)))
(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.
 )

I've been banging my head agasint this problem for most of the morning, so I thought it was time to ask on here. Any help towards getting my indentation working correctly would be a huge help!

TIA


texts:
This is my scenario:

My branch is rebased against some other branch
that other branch changed and I want to get mine back to sync
I do a rebase and magit makes me go through all commits and merge

In terminal I would do this with a git rebase -X ours root-branch. Is something like that possible with magit? If that's not possible, is there some alternative for what I'm trying to achieve?


texts:
I try to use a example block as input to babel block, I want to export babel results only, in below example, I try to add exports none to example block but it doesn't work, the example content exported to html page as well.
How can I disable example block export?
* example
#+name: input
#+begin_example :exports none
5 1 3 2 0
#+end_example

#+begin_src python :results output :eval yes :var x=input :exports results
import matplotlib.pyplot as plt
import numpy as np

x = np.array(x.split())
x = x.astype(int)
fig,ax = plt.subplots()
ax.plot(x)
plt.savefig("test.png")
#+end_src

#+RESULTS:

[[./test.png]]


texts:
How to calculate time durations in tables?
Subtraction of numerical vectors works directly:
| day              | t1       | t2       | differences |
|------------------+----------+----------+-------------|
| [2021-04-08 Thu] | [10, 13] | [16, 18] | [6, 5]      |
#+TBLFM: $4=$3-$2

Using this with time vectors to compute durations doesn't work. It computes only the first item:
| day              | time 1         | time 2         | durations |
|------------------+----------------+----------------+-----------|
| [2021-04-08 Thu] | [10:45, 14:00] | [12:00, 15:00] |     01:15 |
#+TBLFM: $4=$3-$2;U

I would expect this:
| day              | time 1         | time 2         | durations     |
|------------------+----------------+----------------+---------------|
| [2021-04-08 Thu] | [10:45, 14:00] | [12:00, 15:00] | [01:15, 1:00] |

I hope there is an (easy) solution (?)

EDIT: The n-th item of 'time 2' would be always larger than the n-th item of 'time1'. I don't know if this makes it simpler.

EDIT2: I've tried it with elisp. My idea was to convert the time into minutes, so 10:45 should be converted to 10x60+45=645.
I've found an org function for it, the evaluation of the following line is "645.0".
(org-duration-to-minutes "10:45")

Then I can make the "vector subtraction" with the numbers, then I just have to reconvert the results. There is the function org-duration-from-minutes for this purpose.
That was the idea but I wasn't able to let it work in the table. I'm not familiar at all with it.
Even this simple formula doesn't work -- "ERROR":
| day              | time 1         | time 2         | time2 in minutes | durations |
|------------------+----------------+----------------+------------------+-----------|
| [2021-04-08 Thu] | [10:45, 14:00] | [12:00, 14:00] | #ERROR           |           |
#+TBLFM: $4='(mapcar 'org-duration-to-minutes $3)

I would expect "[720.0, 840.0]".
(This would be an intermediate step.)
I also tried to change the format into "10:45 14:00" or "(10:45 14:00)" or "(10:45, 14:00)".. It didn't work.

EDIT 3: I've found a solution. See below.


texts: What are the key bindings relevant to week-genda view?

texts: Reminder: one enters the week-agenda view by typing C-c a a. Only serendipitously did I find out that ! toggles "deadline inclusion". How would I find the description of similar key bindings from within Emacs, pertinent to this view?


texts: How do you grep/ag in specific subdirectory of a project?

texts:
projectile-greps are probably the commands that I use the most. However, with some very large projects I am frequently interested in grepping only one subdirectory of the project. For my greps I usually use helm-projectile-agbut it recursively greps in project's root.

The closest think that I have found is helm-do-grep-ag but it works on default-directory. To achieve the effect on grepping specific directory I first have to set that directory as default-directory.

How do you achieve grepping in project's subdirectory?
Is there some parameter that I am terribly missing somewhere?


texts: Filter agenda for all open TODO items and all DONE items from past 7 days

texts:
I would like to use org-mode to facilitate weekly standups at work with people. I would like a workflow whereby I can filter the org agenda TODO list to only contain open all open TODO items in addition to DONE items that were marked DONE in the past 7 days.

I am aware of the archiving workflow but I would rather not have to archive things, just have them disappear from the agenda view after a period of time.

Is such a thing possible with a custom agenda view? I have been trying to do something with log-mode but have not been successful thus far.


texts:
Org-mode's agenda view can display local holidays after enabling it in org-agenda-include-diary. This however displays US holidays (such as President's Day). What is the simplest way to configure it to show Canadian holidays?

Per Emacs manual,

  The general holidays are, by default, holidays common throughout the United States. In contrast, holiday-local-holidays and holiday-other-holidays are both empty by default.

So, how would I use use either of those variables to replace the US holidays with Canadian holidays?

The manual further gives an example of adding a single  holiday:

  (setq holiday-other-holidays '((holiday-fixed 7 14 "Bastille Day")))

How would I go about adding all of the Canadian holidays? Are there no predefined lists I can use?


texts: Insert a string from eval-expression without the quotes

texts:
I want to use C-u M-:, then (format-time-string "%m/%d/%Y") to insert a customized date string. But it is inserted into the current buffer with double quotes.

Any trick to remove these quotes?


texts:
I use mu4e for email with multiple accounts. I have multiple accounts in mu4e and followed the manual with a function my-mu4e-set-account and a hook to it:
(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)

I can start a message with
(compose-mail "To <to@to>" "subject" '(("From" . "me <me@me>")))

I get queried twice about which account to use:
[mu4e] Select context: [A]ccount1 [S]omeOther
Compose with account: (Account1/SomeOther)

and then the "From" of my choice is overwritten by the selection from mu4e.
How can I set the "From" header programmatically without mu4e asking for the context twice? And how can I pre-fill the body of the email, since compose-mail only takes headers in the other-headers argument and the body is not a header?
Update: Following the comments, here is a scenario. I have a list of 20 email addresses to which I want to send a similar email with a custom To: and the name in the body. I would like to send those twenty emails programmatically from mu4e:

initiate the email
set the right context with the From: address
set the subject
set the custom recipient
set the body, customized to the recipient
send the email

At the moment, the interactive prompts interrupt me at step 2 of setting the From: address. The second prompt was my blunder from adding a function from the manual:
(defun my-mu4e-set-account ()
  "Set the account for composing a message.
   This function is taken from:
     https://www.djcbsoftware.nl/code/mu/mu4e/Multiple-accounts.html"
  (let* ((account
    (if mu4e-compose-parent-message
        (let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir)))
          (string-match "/\\(.*?\\)/" maildir)
          (match-string 1 maildir))
      (completing-read (format "Compose with account: (%s) "
                               (mapconcat #'(lambda (var) (car var))
                                          my-mu4e-account-alist "/"))
                       (mapcar #'(lambda (var) (car var)) my-mu4e-account-alist)
                       nil t nil nil (caar my-mu4e-account-alist))))
         (account-vars (cdr (assoc account my-mu4e-account-alist))))
    (if account-vars
        (mapc #'(lambda (var)
                  (set (car var) (cadr var)))
              account-vars)
      (error "No email account found"))))
(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)

From the comments, I can set the body with message-goto-body and insert. So the only other question is how to set the right context programmatically. I disabled the context switch hooks and tried this code:
(compose-mail "" "" '(("From" . "me <me@domain.com>")))

and I get a draft from the last used context email address and a body with a mysterious 158 in it.
Second update: I read the Contexts part of the manual and am still unclear on how to set the right context. The variables mu4e-contexts and my-mu4e-account-alist are set to my list of accounts, e.g. Account1 and SomeOther, and I don't know how to tell mu4e to pick the one that matches a string such as SomeOther. I tried
(setq mu4e-compose-pre-hook nil)
(mu4e-context-switch nil "SomeOther")

I compose a new message with C-x m and still get a draft from Account1.
Although the suggestion of auto-answer in a comment could work, I believe a more straightforward solution exists.


texts: How get emmet, php-mode and indentation of html work together?

texts:
I want emmet and php-mode work together.
I want correct html indentation with php-mode enabled.

I know web-mode but I don't like it.


texts: How to display certain buffers below the selected window?

texts:
For now I can open Help buffer below current one by splitting its window using regex

(add-to-list 'display-buffer-alist
             '("^\\*.*\\*$" . (display-buffer-below-selected)))

How can I make it so that the same behaviour applies to *shell* and *man* to name a few.

UPDATE: opening through command works for *shell* but if I have multiple shells in switch buffer is there streamlined way to temporarily open them?


texts: Does `` obviate `-*- coding: utf-8 -*-` in an HTML file?

texts:
Is writing <meta charset=utf-8 /> in an HTML file (being edited by Emacs) sufficient, or do I also need to specify -*- coding: utf-8 -*- on the first line?

In other words, do I have to write

<!DOCTYPE html>

    <meta charset=utf-8 />

你好，世界！

Xin chào thế giới

or is it sufficient to write

<!DOCTYPE html>

    <meta charset=utf-8 />

你好，世界！

Xin chào thế giới

to signal to Emacs that I'd like the file to be saved in utf-8?

I'm using web-mode.el for HTML pages (because it is the nicest way at this time to edit an HTML page that may also contain CSS and JS code).

And if you know the answer, you won't mind my trying to sneak a second question here: Why is Emacs (25.3.1) unable to properly encode display the Vietnamese text above (which SO handles just fine), even though the same Emacs handles the Chinese text with no difficulty?


texts: Make evil paragraphs behave like vim paragraphs

texts:
I have moved from vim to emacs using evil-mode. I've found that I prefer emacs (as long as I can edit text vim style), but I have one small inconvenience. I've found, mainly while writing prose, but also in other situations, that the evil paragraph movement does not behave as I expect.

Here is an example of the unexpected movement. Starting with the cursor/point on the # Heading 1 line and pressing } repeatedly to move forward a paragraph, I have marked with a ~ character where the cursor/point moves:

Example file

# Heading 1

## Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Cras mollis velit vitae sem dictum fermentum.
Vivamus id varius urna. Nullam consectetur elit velit, quis molestie est malesuada non.
Aliquam pretium lacinia viverra. Sed mollis libero ac nisl porttitor dictum. Pellentesque a placerat felis.

Vim behaviour

# Heading 1
~
## Heading 2
~
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
~
Cras mollis velit vitae sem dictum fermentum.
Vivamus id varius urna. Nullam consectetur elit velit, quis molestie est malesuada non.
Aliquam pretium lacinia viverra. Sed mollis libero ac nisl porttitor dictum. Pellentesque a placerat felis.
~

Evil behaviour

# Heading 1

## Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
~
Cras mollis velit vitae sem dictum fermentum.
Vivamus id varius urna. Nullam consectetur elit velit, quis molestie est malesuada non.
Aliquam pretium lacinia viverra. Sed mollis libero ac nisl porttitor dictum. Pellentesque a placerat felis.
~

This has meant that I cannot use commands involving the paragraph such as dap, yip, etc.

Is there a way to make emacs evil-mode paragraph motions work as they do in vim?


texts: Apply settings in .dir-locals.el to both c and c++ major modes

texts:
Is there a way to specify the same settings for c-mode and c++-mode without repeating the alist?
I have:

((c-mode . ((comment-start . "/* ")
            (comment-end . " */")
            (comment-padding . 0))))

and would like to avoid:

((c-mode . ((comment-start . "/* ")
            (comment-end . " */")
            (comment-padding . 0)))

 (c++-mode . ((comment-start . "/* ")
              (comment-end . " */")
              (comment-padding . 0))))


texts: How to convert the emacs manual to org format?

texts:
I like to read the Emacs manual on a hard copy but I would like to have a copy in org format to kill parts that I have understood and so to only keep what's important to remember (titles, functions and keybindings mostly).

I have tried with pandoc from the Html version to Org but there is a lot of garbage in the file. I suppose the solution is to convert the texi files to html and after to org with pandoc to get a cleaner result.

I have seen that there is many HTML Customization Variables
that can be passed to texi2any translator. Which ones do I have to use to get a nice output for pandoc?

Thx.


texts: Preserve Evil state when jumping between org-edit-special and org-mode

texts:
When executing C-' (org-edit-special) it always starts in normal evil state even if I am in insert state originally. Same when jumping back, if I am in normal state then it switches back to the original state before jumping.
How to preserve state when jumping between special editing and org-mode in Evil?


texts: Do m-x command on entering buffer with a specific file type

texts: Sorry if this is a really noob question. I have recently gotten into Emacs with the Spacemacs distribution and I installed a plugin called "focus." I want to be able to have the command "focus-mode" run when I open a specific buffer type, but I don't know to do this. I have to do M-x and type in "focus-mode" and it's kind of inconvenient. I really don't know Emacs Lisp that well. Is there anything I can put in the user config to achieve this? Thanks in advance.


texts: How to run sql-postgres without password?

texts:
My PostgreSQL authenticates using Unix Domain Sockets (Trust Authentication). When I run psql I do not need a password to connect to the database.

But when I run sql-postgres, I am always asked for a password. How can I tell Emacs, that I have no password?


texts: Emacs crashes when trying to read an RSS feed with gnus

texts:
I use gnus (by way of gwene.org) to read RSS feeds. However, for the first time I've ever seen, Emacs crashed when trying to open a feed, giving the following dump at the terminal:

Fatal error 11: Segmentation fault
Backtrace:
emacs[0x5032b3]
emacs[0x4e99be]
emacs[0x50206e]
emacs[0x502293]
/usr/lib/libpthread.so.0(+0x10d60)[0x7f55c97b7d60]
/usr/lib/libOpenCL.so(+0x1a7c6a)[0x7f55b5be8c6a]
/usr/lib/libOpenCL.so(clGetDeviceInfo+0x8f0)[0x7f55b5bc4150]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x14c4a9)[0x7f55cb9fa4a9]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(InitOpenCLEnv+0x7c)[0x7f55cb9fb3ec]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x445c0)[0x7f55cb8f25c0]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(AccelerateCompositeImage+0x79)[0x7f55cb901839]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(CompositeImageChannel+0x2aa)[0x7f55cb94060a]
/usr/lib/libMagickCore-6.Q16HDRI.so.2(MergeImageLayers+0x1e8)[0x7f55cb9ddbc8]
/usr/lib/libMagickWand-6.Q16HDRI.so.2(MagickMergeImageLayers+0x4a)[0x7f55cbe286ca]
emacs[0x5cd29c]
emacs[0x5d0b11]
emacs[0x5d0f4e]
emacs[0x55d18c]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
emacs[0x55cfab]
emacs[0x5927b3]
emacs[0x55cc0f]
...
Segmentation fault (core dumped)

What could possibly be the case here?


texts: I'm using org-babel blocks to generate a Graphiz diagram for a presentation. Normally the output goes to a file which is what I want. However if the file is empty something went wrong. Is there an easy way to see stderr/stdout of the program, preferably separate from the file output?


texts: How can I kill all unmodified buffers / files and delete their related frames?

texts:
How can I close all unmodified buffers?

Usually after a day of work - I've got a ton of buffers / frames open. Right now I have to navigate to each frame and close it - which then prompts me if the file has been modified.


texts:
Q: how can I detect the keyboard layout from Emacs?

I'm writing some code that will set keybindings dynamically by selecting easy-to-reach keys (eg, those on home row).  To do this, though, I need to to know which keys correspond to home row on the user's computer.

I could default to assuming that the computer uses the QWERTY layout, but that's not very portable for people using alternate layouts (I, myself, use Dvorak).

How would I detect the keyboard layout?  Is there anything portable (in pure elisp) that does it, or would one need to drop to the system level to do it?

(I've browsed through various *-keyboard-* and *-input-method-* variables, and may have missed something obvious.)

PS: there's an old SO thread with a similar title that does not answer this question.


texts: How do i switch to evil-normal-state on save

texts: I am new to spacemacs and currently save fils by s-s (aka: cmd-s). I would like to switch to evil-normal-state each time I save. How do I do this?


texts: I have a tracked file in a git repository. How do I untrack this file without deleting it using magit?


texts: How to determine if a string is a valid file name?

texts:
Q: How do I determine if a string is a valid file name (i.e., uses
only valid characters)?

The variable file-name-invalid-regexp was the only thing I could
find (docstring: "Regexp recognizing file names which aren’t
allowed by the filesystem.")  However, the value it gives on my
machine (linux) is [^@] (the special character, not the literal "^@").


texts: Setting python version for live-py and python-excecute-file (SPC m c c) in spacemacs

texts:
Im new to Emacs, i hope i didn't miss anything simple.

My configuration is:

OS - OSX sierra 10.12.6.
Emacs - 25.3.1 (Emacs-emacs-plus from homebrew)
python - trying to set 2.7.14.

I want to make myself a decent developing environment for python, there is one problem i'm not sure how to solve.

I want emacs (and all layers) to use python from this path: /usr/local/bin/python2

I seted in .spacemacs file at (defun dotspacemacs/user-config ():

    ;; python:
    (setq python-shell-interpreter "/usr/local/bin/python2")
    (setq py-python-command "/usr/local/bin/python2")
    (setq python-shell-completion-native-enable nil)

Now when i execute run-python:

 it works well and start with desired version.

But when i'm editing python file in python-mode and trying to launch either live-py or python-execute-file it opens up in system default python version.
i.e.:

different path.

What i am doing wrong?

Thank


texts: Reverting the keybindings that I don't specify in the init files without restarting emacs?

texts: When I have test-assigned some function on mouse-3, and I want to revert the default feature assigned to it to compare which function is more useful to assign to the mouse-3, I have to comment out the particular assigning statement from the init file, and then restart emacs. I could do (global-unset-key  (kbd "")), but that would just unable the mouse-3 instead of get back the default feature assigned to it. It's cumbersome to restart emacs every time I'm in this kind of situation (I've been in this kind of situation many times.); is there a way to do this without restarting?


texts: How to disable eldoc when using TRAMP (editing files over SSH)

texts:
Eldoc really bogs down the editor when used over SSH with TRAMP. I want to disable it in those cases.
What I've tried is this:

  (defun no-tramp-eldoc ()
    (interactive)
    (when (string-prefix-p "/ssh" (buffer-file-name)) (anaconda-eldoc-mode -1)))
  (add-hook 'python-mode-hook 'no-tramp-eldoc)

Regarding that last line, I'm not sure if it should be

(add-hook 'python-mode-hook #'no-tramp-eldoc)

instead, but I've tried both and it does not work.

The no-tramp-eldoc function itself should be correct: when called manually, eldoc does get disabled in TRAMP/SSH buffers --- it's the hook that does not work; maybe something re-enables eldoc after the hook has run?

I'm using Spacemacs.


texts: how do I quickly remove lines from emacs buffer

texts:
In an emacs buffer when editing a file called "log/development.log"
how do I quickly remove all lines containing the word "Render"


texts: edebug-defun indicates a malformed cl-loop

texts:
The following code evaluates successfully using eval-defun and runs as I would expect:

(require 'cl-lib)
(defun my/sample-function ()
  (let ((my-ht (make-hash-table)))
    (puthash :a 1 my-ht)
    (puthash :b 2 my-ht)
    (cl-loop for key being the hash-keys of my-ht using (hash-values value)
             do
             (prin1 (cons key value)))))

with

(my/sample-function)
=> (:a . 1)(:b . 2)nil

However, edebug-defun complains:

Debugger entered--Lisp error: (error "Bad ‘using’ clause")
  signal(error ("Bad ‘using’ clause"))
  error("Bad `using' clause")
  cl--parse-loop-clause()
  #[128 "\306\307\310\311\312\311\306\313!\"\"\">\204\314\312\315\3...
  macroexpand((cl-loop for key being the hash-keys of my-ht using (edebug-a...
  macroexp-macroexpand((cl-loop for key being the hash-keys of my-ht using ...
  macroexp--expand-all((cl-loop for key being the hash-keys of my-ht using ...
  ...

I imagine that edebug is choking during instrumentation on the hash-table -specific parts of the complex cl-loop macro.  This is the first time I've encountered this sort of problem with edebug.

I'm not certain that this is not the result of user-error though. In Common Lisp documentation the keywords appear singular with a different verb ordering (example source):

(loop for k being the hash-key using (hash-value v) of h do ...

However, the structure used within my/sample-function above is the only form I have found to eval successfully.

I couldn't find anything relevant in debbugs.

emacs -Q version 25.1.1


texts: Jump to and highlight characters matching regex

texts:
How can I jump to the next character matching a regex (see example below)? And if possible, enable highlighting of all the matching characters in the buffer when I jump for the first time.

[^\x20-\x7eéèëê]

This article says how to do it for non-ASCII, but I want to allow certain non-ASCII characters. I tried occur, but it doesn't seem to accept \x##. Regardless, jump and highlight is highly preferable.

Update: To use  isearch for my purpose, I modified this snippet. However, it seems to do a literal search, even if I have t as argument. How do I make it do a regex search?

(defun my-search-word ()
  (interactive)
  (isearch-forward t 1)
  (isearch-yank-string "[^ -~éèëê
]"))

Note: I had to include a literal newline in the search string to prevent highlighting all newlines.


texts: The command C-l scrolls the current line to center, top, bottom. Is there an analogous command that scrolls the current column to center, left, and right?


texts: How can helm-find-files be adapted to include previously open files, projects etc?

texts:
After doing some more search concerning Does the recent files in emacs display files opened in previous sessions? I realize that C-x C-f is bound in my config to helm-find-files.
How can helm-find-files be configured to include previously open files, previous projects' directories etc in the original search list, followed by files from general disk searches? C-c p F is mapped to projectile-find-file-in-known-projects which shows files in previous projects.

But as C-x C-f is the default keys for opening a file I want it to combine previously used files, project directories  then the general file system in the search.


texts: I have some customizations for emacs that I'd like to use for a single project, but not affect emacs globally. Is there any way I can have emacs load a specific init file when launched from a certain directory or automatically load all init files in the directory its launched from?


texts: Can I have a single #+TBLFM for multiple org tables?

texts:
I have multiple tables like below in an org file, but all having identical #+TBLFM lines. Is it possible to have just one #+TBLFM and have all these tables use it?

#+NAME: IOC
|  Rate | Units |  Amount |  Charges | Time             |
|-------+-------+---------+----------+------------------|
| 170.3 |    -6 | -1021.8 | -0.86853 | [2018-05-28 Mon] |
| 174.1 |     6 |  1044.6 | -0.88791 | [2018-05-31 Thu] |
|-------+-------+---------+----------+------------------|
| Total |     0 |    22.8 | -1.75644 |                  |
#+TBLFM: $3=$1*$2

(The original #+TBLFM has a large number of simple formulae. Currently if I have to change it, I copy and yank to every place.)


texts: How to install latest version of org mode?

texts:
I want to update to the latest version of Org-mode to test a bug fix. I followed the instructions:

cd ~/src/
git clone https://code.orgmode.org/bzg/org-mode.git
cd org-mode/
make autoloads

Then I launch emacs without initialization:

emacs -nw -q

and evaluate:

(add-to-list 'load-path "~/src/org-mode/lisp") ;; result: ("~/src/org-mode/lisp" ...)
(org-version)  ;; result: "9.1.9"

which shows that it is using the built-in version, not the one from git (the compiled file org-version.el shows "9.3.3").

I was able to install the latest version when I filed the bug report. Then package-list-packages would show the built-in org package as masked by another; I can't remember how I did it and now the built-in package is not masked.

I am on macOS 10.14.6 and GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-09-02.

I have tried How to update Org to latest version using package repo's / git clone in Ubuntu without success. This thread is for Ubuntu.

What is preventing my machine from using the latest version of org-mode?


texts:
line-number-at-pos works fine when visual-line-mode is off.
But I can't find its equivalent for visual-line-mode.


texts: Error "Unknown option `AUTO' for package `fontspec-luatex' " when exporting from org to pdf with lualatex

texts:
When exporting a org file to pdf with lualatex, I get the message PDF file produced with errors. in my minibuffer. Upon inspection, I find
! LaTeX Error: Unknown option `AUTO'  for package `fontspec-luatex'

in my LaTeX output. Why is that?
In my configuration, I have (setq org-latex-compiler "lualatex") and there is ("AUTO" "fontspec" t ("xelatex" "lualatex") in org-latex-packages-alist. From what I understand, whatever option should passed to fontspec should be determined automatically.


texts: `text-property-not-all` doesn't seem to work as documented

texts:
Why I get 1 instead of nil for following function? Am I misunderstanding how text property searching works?

(defun set-properties()
  (interactive)
  (add-text-properties 1 6 '(test "em"))
  (message (format "%s" (text-property-not-all 1 6 'test "em"))))

Yet, this function prints "em" as it should:

(defun get-single-property()
  (interactive)
  (message (format "%s" (get-text-property 1 'test))))

I was using functions on plain text buffer with 6 letters.


texts:
I am writing a simple package for myself to try and learn some elisp - and to begin extending Emacs for my own personal workflow. This function processes the current buffer contents with a command line utility and pipes the output into a temporary buffer. This is what I have so far, and it processes the buffer as desired

(defun doStuff ()
  (interactive)
  (with-output-to-temp-buffer "*stuffed*"
    (shell-command
     (..cli stuff here...)
     (pop-to-buffer "*stuffed*")
     ))
  )

What I'm looking for is a way to replace the contents of the current buffer, in such a way that if I press "q" it will revert to the original buffer contents. Can anyone give me some pointers on how I might go about that?


texts: Can gnus handle "maildir" format mail files with ".eml" extension?

texts:
I've been using "gnus" for reading/writing mail in MS Windows, but to make
Windows recognize mail file, I want to add ".eml" extension to each numbered
mail in "maildir" format.

Is there any way to attach extension to gnus mails with "nnmaildir" backend?

Thanks in advance.


texts: Can behavior of `W` be changed by modifying syntax entries?

texts:
I want dW and dB to not delete brackets in racket (all 3 kinds [, (, {).

I'm looking at changing W and not w because w is still useful for changing parts of an identifier, e.g. I can easily change any-of-these-dash-separated-parts individually.

There is no explicit entry for W in documentation https://www.emacswiki.org/emacs/EmacsSyntaxTable

So I'm left wondering how I might modify it.


texts: How to remove leading commas from org mode src block results

texts:
I have a block like this:

#+BEGIN_SRC sh :results org
  stuff
#+END_SRC

with the output looking like:

#+RESULTS:
#+BEGIN_SRC org

,* Heading
,** sub heading
Text

etc.
#+END_SRC

How do I get rid of the leading commas?


texts: Can an org table automatically syncronize with another org table?

texts:
I have two org tables

#+TBLNAME: contact_info
| Name       |  ID | E-Mail          |
|------------+-----+-----------------|
| Washington | 001 | george@usa.pres |
| Adams      | 002 | john@usa.pres   |
| Jefferson  | 003 | thomas@usa.pres |
| Madison    | 004 | james@usa.pres  |

#+TBLNAME: ages
| Name | Age |
|------+-----|
|      |     |
|------+-----|
| Mean |   0 |
#+TBLFM: @>$2=vmean(@<<$2..@>>$2)

I would like the first column of ages to synchronize with the first column of contact_info. In other words, I would like ages to look like

#+TBLNAME: ages
| Name       | Age |
|------------+-----|
| Washington |     |
| Adams      |     |
| Jefferson  |     |
| Madison    |     |
|------------+-----|
| Mean       |   0 |
#+TBLFM: @>$2=vmean(@<<$2..@>>$2)

Furthermore, if I change contact_info to

#+TBLNAME: contact_info
| Name       |  ID | E-Mail          |
|------------+-----+-----------------|
| Washington | 001 | george@usa.pres |
| Adams      | 002 | john@usa.pres   |
| Madison    | 004 | james@usa.pres  |
| Monroe     | 005 | james1@usa.pres |
| Adams      | 006 | john1@usa.pres  |

then I would like ages to update to

#+TBLNAME: ages
| Name       | Age |
|------------+-----|
| Washington |     |
| Adams      |     |
| Madison    |     |
| Monroe     |     |
| Adams      |     |
|------------+-----|
| Mean       |   0 |
#+TBLFM: @>$2=vmean(@<<$2..@>>$2)

Is this sort of thing possible?


texts: org-mode-external-link weird search results in Tex file, "No Match"

texts:
Recently start exploring org-mode, find it awesome so far.
I use Emacs+Auctex for editing my tex file and tried to create a link that links to my tex file directly to the exact line in my org file.
I found some weird results as shown in the screenshot below.

The ridiculous thing is the search doesn't work for \begin{} but work for \end{}. Anybody knows how to fix it? Or is this a bug?

Thanks for all the helps.

EDIT1: What I expect is that, when I click on the link, it will direct me to the relevant file at the EXACT line according to the search keyword after the :: after the link.
EDIT2 GIF included.


texts: Drill user specified tags with org-drill

texts:
I have multiple files with drill items. Many of them have additional tags to further categorize the drill question.

There are times where I don't want to drill all due items but just the ones that are tagged a specific word (e.g. :spanish:)
Other times, I would like to get drilled in order (e.g., first drill all items that are additionally to :drill: also tagged :python:, then continue with :cpp:, etc.). I don't like mixing completely different drill items, but they are mixed in my files for different reasons.

org-drill does provide the custom variable org-drill-question-tag to change the name of the tag which org-drill looks for, but I don't want to change this variable in my .emacs file every time I use org-drill.

How can I achieve my two requirements? Are there already any kind of functions in place that I can use?


texts:
Here is the code:
$app->helper('turizm_images__get_validation_params' => sub{
                     my $c = shift;

                     my $config = $c->config('upload');

Is it possible to set the indentation in such a way that it will be shown like this:
$app->helper('turizm_images__get_validation_params' => sub{
    my $c = shift;

    my $config = $c->config('upload');

?


texts: Is it possible to file a capture template in a subheading of a day in a datetree?

texts:
In Org-mode, I would like to have a capture template get stored like this:

* 2015
** 2015-05 May
*** 2015-05-21 Thursday     <--- I can get this with file+datetree
**** Todo today             <--- here's the problem
***** TODO something        <--- this is the captured content

Is that possible out of the box? If not, any ideas how to go about implementing it?


texts: How to convert a MULE encoded file to UTF-8?

texts:
I am trying to modify a buffer written by desktop-save to a file. The file is named .emacs.desktop and I am trying to modify it from a Perl script. It turns out that it is saved in emacs-mule encoding.

From M-x list-coding-systems :

U -- utf-8 (alias: mule-utf-8)
  UTF-8 (no signature (BOM))
M -- emacs-mule
  Emacs 21 internal format used in buffer and string.

I would like to read the file in Perl as UTF-8, how can this be done?
(I would prefer a solution that does not depend on a running Emacs server)

(An example: emacs-mule saves the letter æ as two bytes 0x81 0xe6, ISO Latin 1 saves it as a single byte 0xe6, whereas UTF-8 saves it as two bytes 0xc3 0xa6.. )


texts: How to use the same pdf-tools install on OSX and Linux simultaneously?

texts:
Q: how can I get pdf-tools to work simultaneously on OSX and Linux?

I keep my .emacs.d directory synced over Dropbox, and share it between machines running OSX and Linux (Fedora and Ubuntu).  I got pdf-tools off of melpa and successfully installed it on OSX.

The problem is that pdf-tools creates an executable (epdfinfo) in its melpa directory.  The executable it generates on OSX is not usable on the Linux machines (and I presume vice versa).

How can I get pdf-tools to play nice across the different systems?  Can I (should I) generate another executable on the Linux machines to store in the same directory, and if so, how?

The nuclear option, I believe, is to remove the melpa package, go old school, and install pdf-tools by hand -- but do it twice, once for OSX, and once for the Linux systems, and then do some system checking at startup to see which one to use.  That seems like a lot of fuss.


texts: Q: How to speed up ido when opening a file in /etc?

texts:
Emacs 24.5.1, Funtoo.

When I'd like to open a file in /etc, the ido-find-file would stuck for about two minutes. It looks ido is going thru the / dir for caching the directory names, but this is really annoying. This only happens for the first time after Emacs started. Are there a switch that can speed this up?


texts:
I frequently have color-bleed issues in emacs, most often with AUCTeX: all of a sudden and for no apparent reason, the line I'm writing will be fontified as math.

First things first: no, I do not have any lone $ character in a verbatim context. ;)

When it happens, I have a couple workarounds: I use font-lock-fontify-buffer (I have now hooked it into various commands such as save-file), or I scroll back up and back down. Occasionally, when it does not help, I can locate a line at which the font-issue starts, and sometimes there is a visible problem in that line (e.g. $a[b$).

The problem is not related to AUCTeX's syntactic parser, for example texmathp returns the correct answer, regardless of the font.

Given the lack of results from google about it, I'm pretty sure it is a problem in my configuration.
But I can't reproduce the bleeding consistently, so proceeding on a dichotomy search in my init files looks like a daunting task.

Is it possible to examine font-lock's mechanic in vivo, so that I can investigate the bug when I see it?


texts: How to search for headings all the way to the root heading (and preferably file name)

texts:
I am new to emacs, and org-mode pulled me away from vim. I am getting a hang of it. One thing I am missing a lot is a hierarchical search in emacs. I wrote a python script for that in vim, and I am looking for a solution in emacs (org-mode).

Let me explain. Let us say, here is the file:

* People
** Software related help
*** John
*** Amit
** Personal
*** John
*** Mike
* Project
** With Mike
*** Website development

When I am searching for a heading, I usually know I am searching for mike, but once I see that there are too many search results (I use 'swiper-all), I want to narrow the search based what the child headings and parent headings contain. In this case, I might want to extend the search to mike people or mike project based on what kind of heading I am searching for.

In other words, if each heading is a node in the tree, I want to search not only in the node, but in the concatenation of all nodes up to the root. (See a couple other nice-to-haves below.)

Is there any solution or package avaiable for this? If not, can you point me to how to go about writing a script/package for this?

Nice to haves:

Ideally, the file name would be considered as the level zero heading.
Ideally, the order of words in the search term does not matter. I sometimes don't remember if I wrote With Mike below Project heading, or wrote Project below Mike heading. In either case, I want to just search for mike project and be able to find what I am looking for.


texts: configuring the word boundary for word-wrap

texts: Is there a way to configure the word boundary character used for word-wrap like breakat option of vim? The documentation says "When word-wrapping is on, continuation lines are wrapped at the space or tab character nearest to the right window edge". Wrapping at whitespace looks ugly when the text contains a long url.


texts:
I am writing some xelatex code with both English and Farsi (right to left direction) characters in it. Also I am using Emacs' input method (changing with key Ctrl + \) for changing between English and Farsi keyboards. It is great being able to use Emacs movement shortcuts and typing Farsi at the same time.

However I would like to be able to use Farsi input method in minibuffers, like the one opened by searching, too. The (Ctrl + \) key is not available there, and it is very inconvenient to have to change the system level input method two times whenever I want to type some Farsi character in some minibuffer (The whole point of Emacs' input method is to avoid scenarios like this).

So is this possible? If yes, I would like to know if it is possible to use Farsi characters with evil-mode commands (like f) or not. Thank you very much.


texts: In emacs term-mode (not shell-mode), how can we edit a command just like we type C-x C-e in real terminal

texts: In real terminal, if we type C-x C-e, we can edit a typed command using an editor.  Could have similar function in emacs term-mode?  After typing a shortcut, I would like to edit the current command in a new buffer (e.g., similar to the helm pop-up window) instead of opening a nested emacs.  Is there any emacs package written for that?  Thanks.


texts: Cursor getting stuck after splitting windows horizontally

texts:
Recently I have started to split my Emacs windows horizontally. However, when I do this, moving the cursor down frequently raises the following error:

posn-col-row: Wrong type argument: windowp, #<frame buffer/file-name 0x11756e8>

And the cursor will be stuck wherever it is. In the example below, as soon as I hit the dollar sign/newline (I have whitespace-mode enabled to help myself with diagnosis) I can no longer move the cursor down (although I can always move left and right).

The stranger thing, is that if I have a horizontal split with two windows and the same buffer in each window, then the problem only happens in the window on the right...It seems to only happen when I have visual-line-mode disabled - but I have disabled it in certain modes precisely because visual-line-mode seems to do weird things when the window is too narrow, so I would prefer a fix that doesn't involve enabling visual-line-mode. Any suggestions? Thank you!

Update:

This problem was occurring on my work computer, and I just tried to recreate it on my home computer. My configuration is synced through github, so I thought everything was exactly the same, but I just remembered that the version of Emacs I am using at work (the one with the problem) is the one from the Ubuntu repositories, while the one I am using at home (which doesn't seem to have a problem) was compiled from source and is a newer version.

Knowing this, I will do some more debugging on Monday when I get back to my work computer, and maybe just get a more recent version of Emacs.


texts: How can I move the cursor from a shell window to another window in Evil mode?

texts:
Imagine I have following four windows in Emacs:

Window 1 is a shell window (M-x shell). Windows 2, 3, and 4 are normal windows with files open. Evil mode is enabled.
If I am the shell window, how can I go to any other window (2, 3, 4) without using the mouse?
The obvious choice is to use, for example, CTRL-w j to go from 1 to 2, but it does not work.
Emacs version: GNU Emacs 27.1 (build 1, x86_64-apple-darwin19.6.0, Carbon Version 162 AppKit 1894.6) of 2020-10-06
OS: MacOS Catalina Version 10.15.7


texts: Latex equation numbering on left instead of right with org-mode output

texts:
I've got this

\begin{align}
n &= 0 \\
n &= m + 1
\end{align}

in an org-mode buffer. When I produce a Latex output, the numbering n = 0     (1) etc. is properly placed on the right. But an HTML output places the numbering on the left. What do I need to do to have both HTML and Latex output place the equation numbering off to the right? One Latex tip was to include \documentclass[12pt,oneside,reqno]{amsart} where the reqno is apparently the key addition. I'm not sure how to include this in an org-mode file.


texts: TeX Mode : making backward-word behaviour take into account Backslashes (\)

texts:
In TeX Mode, backward-word (M-b) stops when it encounters a backslash character (\).

For example, when the cursor point is after a \begin and I type M-b, the cursor point ends up between the \ (backslash character) and the b character, while I would like to have it before the backslash.

So to obtain this behaviour I tried the following, but it does not seems to be working. Any idea why?

(add-hook 'tex-mode-hook #'(lambda () (modify-syntax-entry ?\ "w")))


texts: I used to be able to access Emacs registers with key sequence that were one item shorter. For example, I could jump to a point with C-xj <register>. This shortcut key seems to be gone in newer Emacsen. I'm wondering why these shortcuts went away and if there's any reason not to add them back.


texts:
I use grep-mode for a set of files and wgrep (writable grep buffer) for editing them. The buffer usually looks like:

I want to find a way to change the view like this:

wgrep and compile-goto-error should work as usual.

Upd. It works for wgrep and compile-goto-error now. Additional spaces for regexp are needed:

(setcar (car grep-regexp-alist)
        "^\\(.+?\\)\\(:[ \t]*\\)\\([1-9][0-9]*\\)[ \t]*\\2")

It turns out wgrep-default-line-header-regexp already had required additional spaces.


texts: Perl script to fetch mail folders, for use with mbsync or offlineimap

texts:
I have been looking at various email setups using different tools within Emacs for the last few months. I looked at various email setups using Gnus, mew, mu4e, wanderlust etc.

While reading one of the setups on some blog, I was trying to setup offlineimap/mbsync. And it requires the name of folders to fetch. On one such blog there was a Perl script to fetch all these folder names automatically. and output them to a file. These folder names can then be used with other configuration scripts to specify which particular folders to fetch.

Now I have finally got a setup which I am staying with and it is working for me. It uses mbsync + mu4e . I have a lot of folders in my mail box as I used to use filters. I was only able to use INBOX and Sent Mails in that configuration, as other folders are a lot. And now I am again looking to find that Perl script.

Does any of you have came across such setup which uses some Perl magic to fetch folders for the configuration?


texts:
I'd like to configure magit so that when I decide to commit my changes I'm shown not only the buffer to edit commit message and the diff of changes but also the magit-process buffer. Is there a way of doing that?

This would help me with my git repos where I have pre-commit hooks defined that return some useful info but don't block the commit.


texts: Introspect whether a process created with `start_process` is still running and when it exits

texts:
I'm using start-process to run a process upon certain events picked up with hooks

(start-process "foo" "*Foo*" foo-command foo-args)

I would like to do 2 things with this.

Prevent the process from being started if it's already running
Print a message to *Messages* when the process is complete

How can I do this please?


texts: Poem in org-mode #+VERSE environment mangled by LaTeX export

texts:
I'm using org-mode to create a handout for a poetry class in which I want to include John Hollander's "Swan and Shadow." It looks great in emacs, but when it's exported to PDF through LaTeX, it no longer looks like a swan and a shadow. In emacs:

Here it is with whitespace-mode active, to show that it's all spaces and not TABs:

And here it is in LaTeX-processed PDF:

What should I do to better preserve the appearance of this poem?


texts: .emacs showing error "Wrong type argument: listp, closed" during start up

texts:
I am getting an error Wrong type argument: listp, closed while starting my Emacs. I tried to debug each line and do a M-x eval-buffer during configuration. At at time, it was showing only End of line in buffer reached. I pasting my complete code below even though most of the come I have commented. I am a newbie in emacs and org-mode, so debugging is bit difficult for me. Kindly help.

Updated .emacs File

;; .emacs after suggestion from lawlist

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(progn (load-theme 'manoj-dark)
       (setq frame-title-format "shree@emacs")
       (tool-bar-mode -1)
       (scroll-bar-mode -1)
       (show-paren-mode)
       (windmove-default-keybindings)
       (require 'package)
       (add-to-list 'package-archives
           '("melpa" . "http://melpa.org/packages/") t)
       (add-to-list 'package-archives
           '("marmalade" . "http://marmalade-repo.org/packages/") t))

Update: Added the back trace of error:

Debugger entered--Lisp error: (wrong-type-argument listp closed)
  package--read-archive-file("archives/marmalade/archive-contents")
  package-read-archive-contents("marmalade")
  package-read-all-archive-contents()
  package-initialize()
  eval-buffer()  ; Reading at buffer position 339
  funcall-interactively(eval-buffer)
  call-interactively(eval-buffer record nil)
  command-execute(eval-buffer record)
  execute-extended-command(nil "eval-buffer" "eval-buffer")
  funcall-interactively(execute-extended-command nil "eval-buffer" "eval-buffer")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)


texts: How can I modify a variable in a javascript file that meets specific conditions?

texts:
Lets say I'm editing a javascript file in emacs that has objects as such scattered through out the file:

foo: [1], foo: [2], foo: [3], foo: [4], foo: [5], foo: [6], foo: [7]
obo: [1], obo: [2], obo: [3], obo: [4], obo: [5], obo: [6], obo: [7]

I wanted to increment each object with a number greater then 3 by N, what would be an efficient way to do so?

It would also be nice to know how to perform the same operation but on a specific object or variable?


texts: Error enabling Flyspell mode (Error: No word lists can be found for the language "en_US")

texts:
I recently saw my emacs (GNU Emacs 27.1 running on Arch Linux) throw this error:
Error enabling Flyspell mode:
(Error: No word lists can be found for the language "en_US".)

when I visited a markdown file. My emacs is configured to use the latest commit on the develop branch of spacemacs. Any idea how I can allow Flyspell to find a word list?
I tried the solution from Error: No word lists can be found for the language "en_US", which was to simply install aspell, but it doesn't fix the problem.


texts: How to display a (basic) column indicator?

texts:
Since fill-column-indicator is no longer actively maintained, how can I visualize the fill-column?

The fill-column-indicator package was quite heavy and had compatibility issues with other packages.

Possible solutions:

Enable line highlighting hl-line-mode only highlighting up until the fill-column.
Display a character on the current line at the fill-column.

... maybe others options I'm unaware of.

Insufficient Solutions:

Noting these since I've seen them posted as answers to similar questions.

Displaying a marker on the mode-line:

Too far away from the current line to be useful.
Using whitespace mode to highlight text beyond the fill column.

While better than nothing. I'd like to be able to see this limit while typing (before I exceed it).
ColumnMarker

Only highlights columns that contains text, again, no way to see the column indicator before you reach it.


texts:
I have an org file at ~/foo.org it looks like this (see bottom of this question)

I reboot my pc every day, and the first thing I do is open this file.
Then I do the mundane task of pressing tab to expand the ** About me
headline.

Is it possible to save this visibility setting? or is it possible to tell emacs to "unfold" this particular heading upon file opening

What I tried: I googled around, there's a guy  who hints at this being possible, but he's very terse and it lacks a concrete example.

* Workshop

** Greetings, Introduction, Organization

- breaks
- drinking
  - vending machines for pops and coffee

** About me

- Flipchart
- 2009-2012: PIM researcher ([[http://tagstore.org]])
  - organizing files and folders
  - an alternative to strict hierarchies of folders
  - tagging


texts: Dump list of current keybindings to standard out?

texts:
I like emacs, I like keybindings. I also like the command line and have a lot of keybindings.

Is it possible to dump emacs keybindings to standard out so that I can search them with things like grep?

Edit: Ideally the output would "play well with command line tools" and be "machine readable". Something like:

"C-x s"  save-buffer     fundamental-mode
"C-a"    beginning-of-line   fundamental-mode

would be nice.

Edit: As people have pointed out the keybindings in emacs   vary depending upon current buffer and position. I would like the "current" bindings, where this is defined as the selected buffer in the last selected frame. These can be accessed programmatically from emacsclient: (emacsclient --eval "(buffer-file-name (window-buffer (selected-window)))" | tr -d '"')

"Clues"

To make clear what I already have thought of, and to give interested readers clues.

The following script dumps functions to standard out in a similar way:

https://pastebin.com/wvPJiUwb

It uses "emacsclient -eval" for the purpose.

I am aware that the describe-bindings function. When I looked at this before the code seemed a little "specific purpose without easy to understand general functions".

I am aware the which-key emacs mode which list keybindings as you type them, so this code might be easy to modify.

This code might be kind of readable.

Alternatives considered

Use emacs self-documentation to find keybindings

I am quite aware of the the ability to search function names and find keybindings associated with functions.
The utility is that keybindings represent "functions that I am aware of and have used before".

Also the the prefix keys that I have used for keybindings represent an indexing of some descriptions (these functions are related to such and such)


texts: Prevent Emacs from messaging when it writes recentf

texts:
I've configured Emacs to save recentf every five minutes by using this code:

(run-at-time nil (* 5 60) 'recentf-save-list)

It works great, but after writing recentf Emacs feels it has to tell me about it, so every 5 minutes I get a message in the minibuffer telling me it wrote recentf.

How do I silence that message?


texts: How to stop backspace from doing kill-region?

texts:
(I'm using Emacs for more than 25 years, starting in version 18.58 I think)

Recently Emacs received changes that make an old-time user quite desperate, and I wonder how to revert some of those dubious "enhancements":

When I set a mark, copy and paste the region, and then want to edit the region (frequently I press C-x C-x to place the mark at the start of the pasted region, then move the cursor and try to replace some text, maybe using backspace or delete), it happened more than once (without me noticing it all the time) that as soon as I edit the pasted region that the whole region is replaced by the character input.
This is especially dangerous if you duplicate a longer block of text: Recently I modified the only copy of it instead of modifying the duplicate.

So which customization setting is responsible for this?
I'm using Emacs 25.3.

(The other "enhancement" I was able to fix myself was that next-line moved down to the next screen line instead of the next buffer line)

Here's an attempt for a reproducable example:

 C-u [universal-argument]
 7 [digit-argument]
 2 [digit-argument]
 a [self-insert-command]
 <return> [newline]
 C-u [universal-argument]
 7 [digit-argument]
 2 [digit-argument]
 b [self-insert-command]
 <return> [newline]
 <up> [previous-line]
 <up> [previous-line]
 C-SPC [set-mark-command]
 <down> [next-line]
 <down> [next-line]
 M-w [kill-ring-save]
 C-y [yank]
 C-y [yank]
 <up> [previous-line]
 <up> [previous-line]
 <up> [previous-line]
 <up> [previous-line]
 C-SPC [set-mark-command]
 <down> [next-line]
 <down> [next-line]
 M-w [kill-ring-save]
 <up> [previous-line]
 <up> [previous-line]
 C-y [yank]
 C-x C-x [exchange-point-and-mark]
 <right> [right-char]
 <right> [right-char]
 <right> [right-char]
 <right> [right-char]
 <right> [right-char]
 <backspace> [backward-delete-char-untabify]

The first backspace kills the whole region.


texts: Why save-excursion doesn't save point position?

texts:
I have the following code:

(defun test-save-excursion ()
  (interactive)
  (let ((buffer "*test*")
        (text "Lorem Ipsum is simply dummy text
Lorem Ipsum has |been the industry's standard dummy text
It was popularised in the 1960s"))
    (with-current-buffer buffer
      (erase-buffer)
      (insert text)
      (goto-char 50)
      (save-excursion
        (beginning-of-line)
        (kill-line)
        (kill-line)))))

You can see that point moves to the 50th char (second line of text, where | is located), then I want to save point position while I'm killing the line of text. But point always moves to the beginning of line. Why that happens so? Is it possible to save point position in such case? How?


texts: Why are my org-table formulas behaving like this after upgrading to version 8.3?

texts:
I recently upgraded org-mode to version 8.3 from version 7.9.

In previous versions of org mode, the function

#+TBLFM: @<$<..@>$>=0

would place a 0 in every cell of a table. On my system, the output is

|   |   |   |   |   |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 |
#+TBLFM: @<$<..@>$>=0

That is, the first row is skipped. What's going on?!

I even have the unexpected

|   |   |   |   |   |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 |
#+TBLFM: @1$1..@3$5=0

|   |   |   |   |   |
|   |   |   |   |   |
|   |   |   |   |   |
#+TBLFM: @1$1..@1$2=0

while

| 0 |   |   |   |   |
|   |   |   |   |   |
|   |   |   |   |   |
#+TBLFM: @1$1=0

So it appears that the first row is ignored if the region is a rectangle. Why? Is anyone else running 8.3 getting these same results?


texts: Assign evil-mode keys dependent on major-mode

texts:
I would like to assign evil-mode normal-state key bindings dependent on what major mode I am currently working in.

E.g. I am using org-mode and I want a set of keys and if I use AucTeX I want a different set of keys.
Potentially there are keys that behave differently under different major modes because I want to keep a certain naming logic.

I tried assigning keys using different minor-modes, however the last loaded minor-mode overwrites the previously assigned key bindings. Switching to a different window with a different major mode does not switch the key bindings back.


texts: how to start term in a separate window at launch

texts:
I added the following two lines to my init.el script.

(split-window-vertically)
(other-window 1)

What I now would like to achieve is to start within the current window a term-mode with a bin/bash. How can this be achieved within the init.el? In emacs I run M-x term and then I'm asked if /bin/bash should be run, hit enter and a terminal is running. I'm struggling to achieve the same within the init.el. Thanks for the help


texts: Ensuring multiple abbrevs expand to same string

texts:
I would like to define multiple abbrevs that expand to the same string. Currently, I have the following in my abbrevs file.
(define-abbrev-table 'global-abbrev-table
  '(("abbrev1" "Some long expansion." nil 0)
    ("abbrev2" "Some long expansion that is identical to the above." nil 0)
   ...

If I want to modify the expansion, I have to manually modify all the expansions. I tried the following as a workaround:
(setq expansion "The long expansion that I want to define multiple abbreviations for.")
(define-abbrev-table 'global-abbrev-table
  '(("abbrev1" expansion nil 0)
    ("abbrev2" expansion nil 0)

But this does not work. I'm probably missing something quite elementary, but is there some way to achieve the above? Thanks!


texts: What are the situations where defining a function as non-interactive is better than interactive?

texts:
Assume that we have a function which can be defined either interactive or non-interactive. When we define it as interactive, we can use it as a command by invoking M-x so we have more freedom.

I am wondering what are the situations where defining a function as non-interactive has some advantages over the interactive method.


texts: Change the way CC-mode font-lock the C++11 `auto` syntax

texts:
With C++11, the keyword auto attained a new syntax and semantics.  However, it seems that CC-mode has not been aware of this.

For example, if I write auto var = exp, I get var in green, in which various types are displayed.  I don't like this; var should look like other variables.

How can I teach CC-mode to do this?


texts: Does the `helm-projectile` package use an index?

texts:
Do the commands of the helm-projectile package consult an index, or do they scan the entire project tree every time they are invoked?

In case they use an index: when is this index created and updated? Is there an explicit way to create/update it?


texts: #ifdef __cplusplus nuisance: How to prevent extra indenting?

texts:
If you ever wrote header files that have to be used by both C compiler and C++ compiler, you'd encounter this particular ifdef.  This construct causes one to insert extra curly braces in the header file, which later makes Emacs attempt to indent everything one level deeper to the right.

Is there any way to make Emacs recognize this ifdef and ignore the indenting created by it?

Here's an example:

#ifdef __cplusplus
extern "C" {
#endif

/* Emacs will try to indent everything here one level to the right */

#ifdef __cplusplus
}
#endif


texts: How to find out what my AUCTeX version is?

texts: How can I find out what my AUCTeX version is? I have Googled this question to no avail.


texts: Are there any benefits of compiling Emacs with one graphical toolkit opposed to another?

texts: It seems the options are gtk, gtk2, gtk3, lucid or athena, motif.  Of course, there are visual differences and one toolkit may be more to your tastes than others.  Apart from that, are there any other differences such as with respect to performance or features?  For visual consistency with other applications, I used to compile Emacs with gtk, however, when I just compiled it with lucid, I had the impression that rendering might be faster with lucid than with gtk.


texts: Can emacsclient focus an existing frame?

texts:
When emacsclient is invoked with the option -c it creates a new frame. In both Windows and Linux, this frame is a window at the top of the Z-stack and has input focus. With option -n (non-blocking) the command window in which emacsclient is invoked regains this position but the new emacs frame only takes one step down the Z-order. I can put the focus back on the emacs frame just by closing the command window. Is there any way to get this behavior with an existing frame, i.e. without -c? The focus question has been asked many times without being clear about whether a new or existing frame is involved. The generally accepted answers seem to revolve around the elisp functions select-frame-set-input-focus and server-raise-frame. I find that these do nothing with existing frame (no -c) and are not needed otherwise. I'm wondering if a viable but ugly solution would be to always invoke emacsclient with -c and in the command line eval an expression that detects the previous frame and deletes it but I don't know how to do this.

Windows 10 and 7 emacsclient version 26.1
Linux Ubuntu-Mate version 18.04 emacsclient version 25.2


texts: Show Link Tooltip mouse over with keystroke

texts:
When I use mouse-over on an Link (thanks to Tobias) it shows an Image and text. When I used display-local-help the image disappeared  (perhaps due to lack of space in the message area).
I want to start the mouse-over with any key. Therefore I need a function name.


texts: how to push kill-ring contents onto system pasteboard (clipboard)?

texts:
I use the brilliant answer from my previous question to copy selected regions of text from Emacs onto my system pasteboard (i.e. the OSX clipboard).

But some functions (e.g. gist-buffer) push output (e.g. a URL) onto the Emacs kill ring, and I'd like to be able to access that text from other OSX apps. (Without having to do yank, highlight region, then pbcopy like I currently do.)

So: How can I push text directly from the Emacs kill-ring to the OSX pasteboard?


texts: How to find all lines in a buffer that match string 1 but do not match string 2?

texts:
I have a build log file that includes information on issues reported by clang-tidy. Each of the lines in the log file that reference an issue identified by clang-tidy contain the string "warning G". The problem is that the vast majority of the issues are not in my code and most of those that are not in my code are in Boost. Each of the lines in the log file that reference an issue identified by clang-tidy in Boost also contain the string "\include\boost/". So what I need is a way to list all the lines in the buffer that contain the string "warning G" and do not contain the string "\include\boost/".
Occur gets me half way there, it allows me to list all lines that match "warning G" but I do not know how to filter out the lines that match "\include\boost/".


texts: I'm using start-process to run mplayer and when playing videos I get a ton of output to stderr from "vdp_...". On the command line I usually just 2>/dev/null but start-process runs it directly without a shell. (I tried start-process-shell-command but it simply does not work at all). call-process lets you provide a list for separate stdout and stderr but it seems start-process does not. I don't see an option to mplayer to inhibit the output. If only there were a way to do with start-process what you can do with call-process. Is there some way I'm not seeing to do this?


texts: Sort by artist in EMMS with compilation albums?

texts:
I've been using the Emacs Multi-Media System and it works pretty well, but one thing i can't figure out how to do is sort by AlbumArtist. This is important, because i have many compilation albums and soundtracks.

Is there a way to sort the music browser by AlbumArtist(defaulting to Artist if the file lacks an AlbumArtist tag)? (btw, i am using libtag because the default tag reader didn't work right on some of my files)


texts: Convert gnu indent options to emacs indentation settings

texts:
I've worked at two places where code is supposed to be indented/formatted according to gnu indent (ie there's a prescribed set of options to gnu indent that's to be used). Is there an easy way to set up emacs to do indentation the same way given the options?

For example, currently I work at a place that uses gst-indent, that is running indent -br -cbi0 -cli2 -bls -l80 -nut -ce -nlp -ci4 -hnl -ts8 -i2 -lps on the file gives the desired indentation style.

Of course the options aren't all about indentation, ideally I would like emacs to honor other aspects of the parameters as for example limiting line length etc.


texts: Org-mode 2-pane writing setup using indirect buffers (or display-buffer-alist

texts:
I am trying to set up a 2-pane writing setup in org-mode (similar to this). I'm using org-tree-to-indirect-buffer, and want to have the following functionality:
1. Opening a specific heading in a 2nd pane: Keeping the cursor is on a heading/ sub-heading and pressing a custom key should open a 2nd pane on the right with just that heading/ subheading in this new (editable) buffer.

For now, I'm able to do this using the following:

(defun org-tree-open-in-right-frame ()
    (interactive)
    (org-tree-to-indirect-buffer)
    (windmove-right))
    (add-hook 'org-mode-hook
    (lambda ()
    (define-key evil-normal-state-local-map [S-return] (quote org-tree-open-in-right-frame))

    (define-key evil-normal-state-local-map [return] (quote org-tree-to-indirect-buffer))

(I've taken this function from the VimValley setup linked above.)

Switch back and forth between the main document and the 2nd pane using keyboard shortcuts. (Done using C-x o, or custom shortcut in evil-mode.)
(This is where I'm stuck) Once in the main document (on the left) and at a different heading/subheading, pressing the same key as in #1 should open this new heading in the 2nd pane (and get rid of what was originally on the second pane). Again, this 2nd pane should be editable.
While I'm editing the buffer on the 2nd pane, headings on the main document (on the 1st pane on the left) should stay collapsed.

Problem: Once I have a 2-pane setup, and am in the main document, pressing the assigned key in Step 1 opens a 3rd pane with the new heading/subheading, but the 2nd pane continues to show in the frame.

Additional dream setup:
The 2nd pane should always open in olivetti-mode with a specific window size and font size (that is, the window with the main document (on the left) to occupy about a 25% - 30% of the frame).

For now, I am opening the 2nd pane as mentioned above, manually resizing the window, starting olivetti-mode for this second pane and increasing the font size. When done editing that section of the document, I close that window before starting a new 2nd pane for a different heading, resizing, starting, olivetti-mode, increasing font size... rinse and repeat. It works for now, but does not seem like an elegant solution.

(I'm not a programmer, and have no experience with elisp; most of my setup is cobbled using code snippets from configs shared by other helpful emacs users. I use org-mode primarily for writing prose and use vim's bindings using evil-mode.)

Other options:  outline-toc comes close to what I'm trying to do. The package shackle looks like it can do what I'm trying here, but I'm not sure how. On another forum, I was told to try display-buffer-alist, but again, I'm unable to figure out how to use it.

I've tried to follow some ideas from the following sources, but haven't been able to make it work.

How can I get an org-mode outline in a 2nd buffer as a dynamic table of contents?

https://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html

https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Views.html#Outline-Views

https://stackoverflow.com/questions/17156595/in-emacs-org-mode-how-to-narrow-display-to-two-subtrees-in-two-separate-files


texts: How to make dired-mode copy and move all marked file in all dired buffer including the one just closed?

texts:
I want to mark interesting files while I am browsing my folders, when I am done with marking, I want to copy these files to another place (with dired copy or dired-ranger-copy) or send them as attachment. To prevent too many dired buffer I have this setting

 (diredp-toggle-find-file-reuse-dir 1)

the problem is when I go into a subfolder and come back, the marks are gone, currently I have to mark in one folder, copy the files, mark in another folder, copy files, it's too many copying operations. I have tried to set reuse dire to nil, but I can't work on all marked files in different buffer either. Is there any package that can let me do that?


texts: Why do these two different use-package declarations (for the same package) have different effects?

texts:
What I want to accomplish is to add a keybinding C-<backspace> to the eshell-mod-map that calls func. That can be done like this,
(use-package eshell
  :init
  (defun add-func-keybinding ()
    (define-key
      eshell-mode-map
      (kbd "C-<backspace>")
      (lambda ()
        (interactive)
        (func "arg"))))
  :hook
  (eshell-mode . add-func-keybinding))

Now C-<backspace> only calls func when inside an eshell buffer. I thought this should be equivalent to,
(use-package eshell
  :after esh-mode
  :bind
  (:map eshell-mode-map
     ("C-<backspace>" . (lambda () (interactive) (func "arg")))))

However, this binds C-<backspace> to func everywhere, e. g., if I press C-<backspace> in the *scratch* buffer, that also calls func. This does not happen when the configuration is done as in the former use-package declaration, there the keybinding is kept only inside the eshell buffer.
However, I fail to see the difference between the two declarations. I would like to fix the latter so it has the same effect as the former, since the latter is a bit clearer and nicer. How can I do this?


texts: how do you fold/unfold complex ruby code blocks

texts:
I found a snippet that let's me fold bad(large) blocks of code

(add-hook 'ruby-mode-hook
          (lambda () (hs-minor-mode)))

(eval-after-load "hideshow"
  '(add-to-list 'hs-special-modes-alist
        `(ruby-mode
                  ,(rx (or "def" "class" "module" "do" "{" "[")) ; Block start
                  ,(rx (or "}" "]" "end"))                       ; Block end
                  ,(rx (or "#" "=begin"))                        ; Comment start
                  ruby-forward-sexp nil)))

(global-set-key (kbd "C-c h") 'hs-hide-block)
(global-set-key (kbd "C-c s") 'hs-show-block)

Unfortunately, this code is not smart enough.

What are my alternatives?

Update: Noticed sublime text does it out of the box


texts: Efficient workflow to write a book in Org-mode

texts:
I plan to write a short statistics textbook using Org-mode. Even if some textbooks have been written using equivalent systems (e.g., the R package bookdown), I have no examples in mind of books directly written in Org-mode.

The LaTeX guidelines of all major editors (e.g., CRC, Springer, Wiley) do not seem to facilitate the use of Org-mode, or at least, they require to build an appropriate workflow I cannot figure out on my own. (I am still a beginner in Org-mode.)

Indeed, they require any part, chapter, appendix, acknowledgments, etc., to be submitted in a separate .tex file, with some precise requirements for each file. A master .tex file then gathers all those files and produce the final output. (Example: Springer class here.)

Has someone already managed to set up an appropriate workflow for this kind of "constraint"? I can imagine two options:

Should I export a series of separate foreword.tex, chapterXX.tex files, partXX.tex files and so on, from one single book.org file? And how to do so automatically each time book.org is exported? (Is it even possible to respect the Springer guidelines by doing so?)
Should I create a series of separate foreword.org, chapterXX.org files, part.org files and so on, export them separately (and manually?) in LaTeX, and finally use the master TeX file from Springer to generate the whole book?

Unfortunately, in both cases, I do not see how to preview easily the whole book when exporting my org file(s), like any other org document. Getting/previewing the final book seem to require several manual operations each time, which would make this workflow really difficult to use.

Sorry for this rather vague question, but I cannot figure out how to proceed to respect those guidelines.


texts:
I have started to use  the  Simple Emacs Spreadsheet (SES) with
GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-17.

When I try to mark/highlight a column with (ses-mark-column), the selection doesn't operate in vertical mode. The same happens if I set mark at point and move the cursor to the upper or lower cells.

As a result of this, copy, cut, and paste does not work either.

When I set the mark an move  vertically with arrows, what is highlighted is also copied and pasted, so also adjacent columns.
With (ses-mark-column), when I try to copy, I get the  "Empty range" message in the minibuffer, which in the message buffer is written as ses-copy-region-helper: Empty range.

Update

This is to make the question reproducible.

After opening a new buffer and setting M-x ses-mode, I fill the buffer/spreadsheet as follows:

After placing the cursor in cell B2, typing  (ses-mark-column), or the related key binding S-M-h, gives:

And this is not what a column selection is supposed to be.


texts: How to use two Source Code Block side by side in the same file

texts:
So, as the question suggest, what i want is to use two different source code block, side by side on the same file. Something like this:
#+BEGIN_SRC shell         #+BEGIN_SRC shell
ls /mnt/                  echo "hello"
#+END_SRC                 #+END_SRC

I need them to be like this mostly for understanding/comparing some output from commands, and while I'm sure it's easier to achieve this by using org-mode and rendering the source code block side by side, in the rendered documents instead, i prefer not doing so.
I also did try using two window side by side with two different files, but i really prefer if everything is on the same file.
Typically, i need the result to be on the same level as the source code block:
#+BEGIN_SRC shell         #+BEGIN_SRC shell
ls /mnt/                  echo "hello"
#+END_SRC                 #+END_SRC

#+RESULTS:                #+RESULTS:
| folder1 |               | hello |
| folder2 |

I used space as delimiter between the two block, but i don't mind if it's any other delimiter (like tab).


texts:
I currently have this in my config file for neotree:

;(neotree-show)
  (setq neo-window-width 25)

Does anyone know how I can set the window width to 25 percent?


texts: Evaluating `org-babel-clojure` blocks returns nill & result

texts:
Why the results is 'nil5'? Can't be just 5?

#+begin_src clojure :results
(+ 1 4)
#+end_src

#+RESULTS:
: nil5

Also:

#+begin_src clojure
(print "Hello World!")
#+end_src

#+RESULTS:
: nilnil

I was expected just to print "Hello World!" in RESULTS.


texts:
Q:  How can I delete a marker after it has been created?

I see how to create markers and how to move markers, but I see nothing in the manual about how to delete them:

Creating:  https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Markers.html#Creating-Markers
Moving:  https://www.gnu.org/software/emacs/manual/html_node/elisp/Moving-Markers.html#Moving-Markers


texts: How to prevent eww from truncating lines?

texts:
On a Mac, I would like to use "text to speech" to read web content.

I am using the eww browser.

"Text to speech" treats line breaks as the end of the sentence so I would like eww to display long lines, wrapped if needed, but not truncated.

I have tried (among many other things) this in .emacs:

(add-hook 'eww-mode-hook
          (lambda ()
            (set-fill-column 99999)
            (auto-fill-mode 1)))

but eww still breaks the lines at the width of the buffer. Can you please advise me how to avoid these breaks?


texts: Why does opening a file take so long in python mode?

texts:
Opening a small python file, with <10 buffers open, takes a long time. Here's a gist of the profile of trying to open this file (giving up with C-g after 2 minutes).

Deactivating ido-mode tells more or less the same story. See this gist for details.

Messages during the opening of the file:

CPU profiler started
Mark saved where search started [3 times]
Making python-shell-interpreter local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!
Making python-shell-interpreter-args local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!
Waiting for process to die...done
Quit

What's amazing is that after I quit the find-file with C-g, and re-open the same file with C-x C-f again, it loads, instantly. If, after this, I try to newly open another small python files, I have the exact same behavior - first time, emacs hangs, second time, emacs opens the file instantaneously.

None of the minor modes that are active seem threatening (I've removed all the cumbersome ones). Here are the minor modes that are activated in python mode (at least as captured when the file successfully opens the second time).

Version

GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian

Modes for buffer that's open while opening the file (same as the ones for the file that will be opened, except instead of *scratch*'s lisp-mode it'll be python for the *.py):

Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Blink-Cursor Column-Number Electric-Indent File-Name-Shadow Font-Lock
Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel Shell-Dirtrack
Tool-Bar Tooltip Transient-Mark

(Information about these minor modes follows the major mode info.)

Lisp Interaction mode defined in `lisp-mode.el':


texts: Using TRAMP through CyberArk Privileged Session Manager

texts:
Normally it is very easy to convert ssh and scp commands into tramp format for access via dired.

For example

The command line

ssh username@hostname

will become

/ssh:username@hostname:

in emacs.

Unfortunately, I'm unsure how to convert even the simplest CyberArk example command for use with tramp:

ssh username@target-username@target-hostname@cyberark-psm-hostname

Question

How will I be able to use TRAMP to connect via SSH when proxying through a CyberArk Privileged Session Manager server?

  I found out this week I will not have access to CyberArk PSM for several more months so I will not be able to test any solutions on my own. My hope is that someone in the community has already figured out how to do this and will share their expertise. Thank you!


texts: Trying to install scad-mode from package repository

texts:
This melpa.org page suggests that the scad-mode package is installable from a package repository. But I tried adding http://marmalade-repo.org/ to my package archives, but scad-mode still doesn't show up in list-packages. Is this page incorrect? I now have
'(package-archives
   (quote
    (("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa-stable" . "http://stable.melpa.org/packages/")
     ("marmalade" . "http://marmalade-repo.org/packages"))))

in my custom-set-variables list.
And in the description, isn't the correct syntax M-x package-intstall, not M-x install-package`?


texts: How to set whitespace-line-colum per mode?

texts:
I'm trying to have whitespace-line-column set to 80 in prog-mode and 100 in web-mode, etc. However when using hooks seems to get ignored, as is always set to 80.

(require 'whitespace)
(setq whitespace-style '(face trailing tab-mark lines-tail))

(add-hook 'prog-mode-hook '(lambda ()
                             (interactive)
                             (whitespace-mode t)
                             (setq whitespace-line-column 80)))

(add-hook 'web-mode-hook '(lambda ()
                            (interactive)
                            (whitespace-mode t)
                            (setq whitespace-line-column 100)))

What is the correct way to achieve this?


texts: EMACS shell mode that supports annotations

texts:
I often find myself doing things like installations or debugging where I would like to be able to work in shell mode but be able to insert annotations as I go. BBEdit has something like this but suffers badly from being not EMACS.

Ideally, such a mode would have some simple syntax for blocks of text that aren't sent to the shell subprocess at all. One possibility is something like Python's triple-quoted strings, inserted ahead if the current command.  For example:

$ echo "Here is one command"
$ echo "Here is a second command"
$ _

This would be the vanilla shell session, cursor at the underscore.  CTRL-P a few times, CTRL-O, and you open a line in the previous command text.

$ echo "Here is one command"
_
$ echo "Here is a second command"
$

Now enter text.

$ echo "Here is one command"
""" This is a longish comment I'm inserting into the text that
won't be seen as a command, and thus won't be sent to the bottom
as a shell command.

The block ends at the matching triple-quote, like this:
"""
$ echo "Here is a second command"
$

I'm sure it's not an excessively difficult hack, but it seems like other people may have wanted this in the past, and I'd rather find an existing package than build my own.


texts: I use gtags. I do M-. to go to the function definition, but then when doing M-* to go back to where I was nothing happen and the minibuffer shows as if I did M-8 . My configuration is here


texts:
My company's I.T. department has assigned our HOME directory to a network server.
With the COVID-19 pandemic we are now using VPN to connect to the company's network.
Having to to go through VPN to access the HOME directory is slowing the initializing of Emacs.
(I have to access the HOME drive through Windows Explorer at least once or Emacs won't find it.)
I would like to have Emacs access the .emacs file in my local user folder without changing the HOME environment variable. (I can't change the HOME directory because other applications use it.)
How do I tell Emacs to use a different folder for initialization, without command line?
(I invoke Emacs by double clicking files in the Windows 10 Explorer.)
Note:  The research of changing the .emacs location all use the HOME environment variable.
I'm using Emacs 27.1 on Windows 10


texts: How can I subscribe to SE RSS feed using Gnus?

texts:
I tried G R https://emacs.stackexchange.com/feeds RET which resulted in the following error:

Debugger entered--Lisp error:
    (error "No feeds found for https://emacs.stackexchange.com/feeds")
  signal(error ("No feeds found for https://emacs.stackexchange.com/feeds"))
  error("No feeds found for %s" "https://emacs.stackexchange.com/feeds")


texts: Is there a way to sort buffers alphabetically in speedbar

texts: By default speedbar displays buffers as they are in the buffer list. Is there a way to sort them by their name alphabetically, either automatically or by triggering the sorting?


texts: How to comment options in org-mode export to beamer?

texts:
Generally in the LaTeX or beamer preamble, we add some packages and options for reference and enable them if required.

%\usepackage{someusefulpackage}

In Org mode export to LaTeX or beamer, when I specify options in the file header, how to comment them out

#+BEAMER_COLOR_THEME: dove
#+LATEX_HEADER: \usepackage{usefulPkg}
#+LATEX_HEADER: \usepackage{notRequired}
#+OPTIONS: toc:nil

How can I comment out some of them ?


texts:
I'm using make-frame-on-display for collaborative editing with a colleague. Everything seems to work OK, but to avoid confusion we tend not to edit the exact part of the same file at the same time.

As a part of my workflow, I like to narrow-to-region, but if I do that during collaborative editing, then the buffer is narrowed not only on my frame/display, but also on that of my colleague. This means I cannot narrow because otherwise she cannot edit the part she is interested in.

Is there a way to make narrow to region be frame specific?


texts: Repeated tasks in Orgmode: how to avoid repeated tasks in the past

texts: Basically, the problem is that when you are behind a "repetitive" weekly task, let's say, one that should have been done 3 weeks ago, and you mark it as DONE, it will move it to the following week, not the week ahead in the future with respect to the current week. So I find myself marking the task DONE as many times as weeks. Is there a way to tell orgmode to skip the past weeks? Thank you!


texts:
I would like to be able to go from this:
Phone number
<input type="text" class="form-control" id="phone" aria-describedby="phoneHelp">

This is in case of quick questions.

to this (very long line intentional):
Phone number<input type="text" class="form-control" id="phone" aria-describedby="phoneHelp">
This is in case of quick questions.

In other words, delete indenting and collapsed whitespace between tags in a selection in an HTML buffer. The general goal is making the file more legible, as the collapsed portions typically are repeated form elements that differ only for a small detail.


texts:
I'm trying to translate some useful aliases from zsh to eshell (because ansi-term sucks).

This is one such alias: alias l "ls -lAh $*"

I want this to be able to receive any number of arguments (because ls can handle any number of args) but I still want this to work without arguments.
Now when I type l in eshell the $* expands to null and ls -lAh null is not a valid command.

I could write wrappers for some of my frequently-used shell commands, but isn't there any better way to do this?

Doesn't eshell have a mechanic for simple substitution instead of aliases behaving like lisp functions?

If this is the only way to do things in eshell, Is there any way to make $* expand to whitespace when it's empty or something?


texts: Copy results of `org-export` directly to clipboard

texts:
I often find myself doing this:

Selecting a region of text in an org file.
Calling org-md-export-as-markdown.
Selecting the converted text in the temporary buffer (can't just do mark-whole-buffer since for these purposes I'm obviously not interested in the empty Table of Contents I get).
Killing the temporary buffer and going back to where I was.

EDIT: Here is my question: How can I write a function that will, after selecting a region of text, do all of that for me? In other words, I want a function which will take a region from an org file, copy the result of org-md-export-as-markdown to the clipboard, and return to the org file I called the function from.

Some related attempts:

John Kitchin has a post where he does something similar to what I'm doing. But he uses texutil, since he wants the output in a format that org won't export to. I'm assuming what I need would be much simpler than that.

Oleh Krehel has a function that copies the converted html from a region as part of his emacs config (see here). But he uses xclip which I believe is not available for macOS.

Abo-abo's function is here

(defun ora-org-to-html-to-clipboard ()
   "Export region to HTML, and copy it to the clipboard."
   (interactive)
   (org-export-to-file 'html "/tmp/org.html")
   (apply
    'start-process "xclip" "*xclip*"
    (split-string
     "xclip -verbose -i /tmp/org.html -t text/html -selection clipboard" " ")))

I presume I can modify something like this by replacing

xclip -verbose -i /tmp/org.html -t text/html -selection clipboard

with

pbcopy < /tmp/org.html

but I can't quite get it to work.

My own, failed attempt so far:

This was my blind attempt at adapting the function ora-org-to-html to use pbcopy instead. (Adapting it to use org-md-export-to-markdown would be fairly straightforward, I think.)

(defun org-to-html-to-clipboard ()
   "Export region to HTML, and copy it to the clipboard."
   (interactive)
   (org-export-to-file 'html "/tmp/org.html")
   (apply
    'start-process "pbcopy" "*pbcopy*"
    (split-string
     "pbcopy < /tmp/org.html")))

Running this does create the file /tmp/org.html but the contents aren't sent to the clipboard. Further, the html file contains the entirety of the buffer I run the function from (which I gather is what the original function was supposed to do) rather than just the selected region. Finally, this function requires creating a temporary file, rather than just using the temporary buffer that org-mode generates with the *-export-as-* functions.

I'm completely illiterate when it comes to elisp so any suggestions, no matter how elementary they seem, would be most welcome.


texts: How to prevent M-x package-install from editing my ~/.emacs file?

texts:
When I install packages with M-x package-install, it edits the ~/.emacs file and adds the following content:
(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.
  '(package-selected-packages '(paredit slime)))
(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.
)

Is there a way to prevent package-install from editing my ~/.emacs file. I write ~/.emacs by hand and keep it neat, so it is quite disconcerting when package-install inserts this big blob of code in between. If package-install really needs to maintain this code somewhere, can I not make it put this code in another file that I can load into ~/.emacs?


texts: Display corresponding key binding of command during M-x completion

texts:
As an example, when I use M-x save-buffer Emacs says in the minibuffer:

 You can run the command ‘save-buffer’ with C-x C-s

I'm using Swiper/Ivy; I want to know if there is a way to instruct Ivy to append the keybinding of a command while it shows the completion options; something like save-buffer (C-x C-s).


texts: Is there a way to integrate Arara as a way to automate the building process of a LaTeX document in Emacs/AUCTex?


texts: How can I set python-mode.el shell completion like default inferior shell?

texts:
Autocompletion in python-mode.el opens another completion window with available completions. It looks like this

But I need to use company completion like default inferior python shell

How can I enable this in python-mode.el? Or maybe I can use default inferior shell with python-mode.el?

Sorry for my bad English.


texts: Are there any pre-existing benchmark suites for Emacs itself?

texts:
(This question is not about writing benchmarks/profiling elisp code, for that, see this question.)

Do any benchmark suites exist for Emacs performance? I'm looking for something equivalent to the V8 interpreter team's standard benchmark or the pypy team's benchmark suite.

I'd like to be able to answer questions like 'is Emacs 24.4 faster than 24.3?'.

Are there any existing benchmark suites?


texts: How to delete all white space during save except for final new line

texts:
I am aware that it is a good idea to have one blank line at the end of each file.  I am also aware that extra white space in a file is bad.  Currently in my .emacs file I have (add-hook 'before-save-hook 'delete-trailing-whitespace)  so that whitespace is removed during saving.

However, despite what the wiki says, this also deletes the final newline from my file.

I tried setting '(require-final-newline (quote visit-save)) but that had no effect.

Is there a way that I can force a newline to be added and all other extra whitespace removed?


texts: require 'modename vs require 'modename-install

texts: I hope to use org files for my configuration. And I found some use (require 'org-install), and some use (require 'org). Any differences?