texts: How can I access an LDAP-Server to autocomplete address headers in message-mode/GNUS

texts: I'm using GNUS to access a bunch of IMAP servers. When composing new messages it would be nice to have access to the companies ldap server for autocompletion on address headers TO/CC/BCC. Is this possible, and if, how?


texts: how to watch and cat and grep with emacs

texts:
This doesn't seem to work in M-x shell

$ watch 'grep "FIX" /tmp/output | tail -n 5'

I see Every 2.0s: grep "FIX" /tmp/output | tail -n 5
and I see My-hostname.local: Tue Aug 28 19:09:22 2018 on screen.

Whats the emacs way of doing it?


texts: Search for string but ignore acute accent?

texts:
I'm trying to search using M-s o or M-x occur. The string that I'm searching for may or may not have an acute accent, eg, "Martín" or "Martin". The output is showing only the terms that has the acute accent (Martín), but I need the term without the acute accent (Martin) in the output also.

How do I get the search to ignore the accents?


texts: Emacs' C-tab seems without effect on my server through ssh

texts:
(Emacs 27.1)
On my local machine <C-tab> is linked to other-window and works well:
.emacs.d/init.el:
(global-set-key (kbd "<C-tab>") 'other-window)

When I install Emacs on a (Debian10-based) server, the same configuration
fails. I access Emacs through (LXTerminal) ssh. <C-tab> does nothing (but calling M-x other-window works, as well as C-x o, the default shortcut) : no error message, no warning. When starting Emacs, no warning message appears in the *Messages* buffer.
On my server and on my local machine, C-h k TAB returns:
TAB runs the command indent-for-tab-command (found in global-map),
which is an interactive compiled Lisp function in ‘indent.el’.
It is bound to TAB.
(indent-for-tab-command &optional ARG) [...]

On my local machine, C-h k <C-tab> returns:
<C-tab> runs the command other-window (found in global-map), which is an interactive compiled Lisp function in ‘window.el’.

It is bound to <C-tab>, C-x o.

(other-window COUNT &optional ALL-FRAMES) [...]

On my server, C-h k <C-tab> returns:
TAB runs the command indent-for-tab-command (found in global-map),
which is an interactive compiled Lisp function in ‘indent.el’.
It is bound to TAB.
(indent-for-tab-command &optional ARG)
[...]

See a similar problem with iTerm here and a related post here.

This is the way I compile Emacs:
sudo apt install -y build-essential git apt build-dep -y emacs25 git
clone --depth 1 --branch emacs-27
https://git.savannah.gnu.org/git/emacs.git
cd emacs
./autogen.sh
./configure make make install cd ..

emacs --version


texts: Finding next and previous entries in an avl-tree

texts:
I am using an avl-tree to maintain a sorted list, e.g.:

(require 'avl-tree)

(let ((tree (avl-tree-create (lambda (a b) (string-lessp (car a) (car b))))))
  (avl-tree-enter tree (cons "b" 0))
  (avl-tree-enter tree (cons "a" 1))
  (avl-tree-enter tree (cons  "A" 2))
  (avl-tree-enter tree (cons  "d" 3))
  (avl-tree-enter tree (cons  "c" 4))
  (avl-tree-enter tree (cons  "C" 5))

  (avl-tree-flatten tree))

leads to this sorted list

((A . 2) (C . 5) (a . 1) (b . 0) (c . 4) (d . 3))

sorted by the car of each cons cell.

I can use a command like:

(avl-tree-member tree '("b"))

which returns the cell (b . 0), but what I really want is to get the next or previous cons cell. I usually do this by finding the index of that cell in the sorted list, e.g. (-find-index) or (cl-position), but neither of these seem to take advantage of the sorted nature of the list. Is there a way to get the next/previous node out of avl-tree (or something similar)?

The real application of this is I have a list of hundreds of journal files sorted by date, and I want to be able to find the next or previous entry like this.


texts: Enable diff-mode for files with diff-ish content

texts:
How do I make Emacs automatically turn on diff-mode for any file with diff-looking content, eg.

--- a.txt
+++ b.txt
@@ -1234,56 +1234,56 @@


texts:
My sqlite database has columns which consist of TEXT objects containing spaces. I'm new to both emacs and programming, and while I want to use emacsql for reasons, it's crucial that I can select on string objects containing spaces.

e.g. (emacsql db [:select * :from table1 :where (= name "John Q Doe-Deer")])
doesn't work, and neither does 'John\ Q\ Doe-Deer: they both returned nil even though an analogous query works in command-line sqlite. What am I missing?


texts: Printing/exporting to PDF from text-mode

texts:
I have been googling and searching for the answer to this question for a while but cannot find a definitive solution. In fact I am more confused than ever. I have no doubt that I am not the first person to run in this problem - an abundance of of 'solutions' but nothing that solves my problem.

I ask for your forbearance since this question has been asked before in one way or another. In short I want to use Emacs as a writing platform. I have done some configuring but I am short of some essential features and cannot find a way to implement those features.

A bit of background, the short version: I'm a long time vi (vim, Gvim and currently MacVim) user. I'm not trying to switch to Emacs as a code editor. During my working life, I made several valiant efforts to switch to Emacs but I had to abandon those efforts because I had work to do and deadlines to meet. I'm now retired and so have the time to apply myself but since I only write small fragments of code these days, I'm happy to stick with vim. But for doing a bit of odd scribbling and blogging I would like to create a distraction free, simple word processor-cum-editor in the style of the early DOS applications like Wordstar and especially, Xywrite. Yes I'm that old.

I'm using Emacs for Mac 25.3 installed via Homebrew. After a lot of fiddling and googling I have set it up the way I like it, for now. This is my ~/emacs.d/init.el file:

(menu-bar-mode 1)
(tool-bar-mode -1)
(toggle-scroll-bar -1)
(set-frame-parameter nil 'internal-border-width 20)
(fringe-mode 100)
(set-face-attribute 'fringe nil :background nil)
;;(setq header-line-format "20")
(setq inhibit-startup-screen t)
(setq initial-scratch-message "")
(setq initial-major-mode 'text-mode)
(enriched-mode 1)
(setq-default word-wrap t)
(set-foreground-color "grey80")
(set-background-color "#2d3743")
(add-to-list 'default-frame-alist '(height . 60))
(add-to-list 'default-frame-alist '(width . 85))
(set-frame-position (selected-frame) 225 35)
(set-frame-font "Menlo 13")
(setq ispell-program-name "/usr/local/bin/aspell")
(setq ispell-dictionary "en_GB-ise-w_accents")

I think it looks great and, it actually works quite well except for the issues in need of solutions. I can spell check, I can highlight, meaning bold, and underline and do italics. I've held off from implementing Flyspell for now because many people have said it slows things down and because one method of implementing it appears to require about 50 lines (or more) of Lisp code. BTW, you will notice on line 7 of my config file that I attempted to set a top border but could not get it to work. Instead I used "internal-border-width" which gives me a bigger space below the mode line but that doesn't bother me.

So my question is: How do I export my prose to a PDF file and retain the simple formatting on the screen; i.e italics and underline etc. And margins. The screen margins and screen line wrap are not retained when printing. Also, it would be nice to be able to change output font size for chapter headings etc. And, I suppose I do need to set an output/print font for the PDF, but that could be a fixed default. One last thing, is it possible to get rid of the little curly arrows at the margins. They seem completely superfluous to me.

Markdown-mode seems overkill for my simple needs. So do the various HTML modes. And Latex would be mega overkill, in my opinion.

I have read "Emacs for Writers by Randall Wood," and watched the Jay Dixit YouTube video on the same subject; amongst others. They don't cover my issues.

I am interested in Org-mode, specifically for the outlining capability and I understand that it has various export capabilities but I'm hesitant to add such complexity when all I really want is just to be able to print; specifically to PDF.

I would be grateful for any suggestions.

Regards


texts: Org-Export does not respect (global-)auto-revert-mode

texts:
When exporting an org document to pdf via LaTeX, C-c C-e l o, if the pdf to be generated has already been visited in an existing buffer, neither of the variables auto-revert-mode nor global-auto-revert-mode are respected.

During the export process, org-export-dispatch calls org-open-file which in turn calls find-file-other-window, which in turn causes part of the problem by calling find-file-noselect with its nowarn argument set to nil.

I'm not sure of the best way to go about this, but I believe the solution would be to modify the yes-or-no-p statement, lines 2040 - 2055 of .../emacs/26.0.50/lisp/files.el.gz:

...

        ((yes-or-no-p
          (if (string= (file-name-nondirectory filename)
                   (buffer-name buf))
              (format
               (if (buffer-modified-p buf)
               "File %s changed on disk.  Discard your edits? "
             "File %s changed on disk.  Reread from disk? ")
               (file-name-nondirectory filename))
            (format
             (if (buffer-modified-p buf)
             "File %s changed on disk.  Discard your edits in %s? "
               "File %s changed on disk.  Reread from disk into %s? ")
             (file-name-nondirectory filename)
             (buffer-name buf))))
         (with-current-buffer buf
           (revert-buffer t t)))))

...

such that when the buffer is not modified and (global-)auto-revert-mode is set, then automatically return yes without prompt.

Not sure if this should be filed as a bug?

When I compile the corresponding tex file that is generated as part of the org-export process, (global-)auto-revert-mode is respected, and the pdf buffer is automatically reverted.

Edit

This issue does not manifest itself when I start a standalone Emacs session, and manually open the compiled pdf with C-x C-f.

It does however, when I am working within a daemon, through emacsclient -c -a "". Emacsclient is my default application for opening pdfs. I.e. in my init file, I have (setq org-file-apps '(("\\.pdf\\'" . "emacsclient \"%s\"")))


texts: mu4e sending email fails when using proxy?

texts:
I'm using PrivateInternetAccess for my proxy and when I enable it, sending email via mu4e times out (although retrieving emails works fine). With the proxy disabled, sending works fine.

Here's a screenshot of my PIA settings:

And how my account is defined:

(defvar my-mu4e-account-alist
  '(("personal"
     (mu4e-sent-folder "/personal/[Gmail]/Sent Mail")
     (mu4e-drafts-folder "/personal/drafts")
     (user-mail-address "foo@gmail.com")
     (smtpmail-smtp-user "foo@gmail.com")
     (smtpmail-default-smtp-server "smtp.gmail.com")
     (smtpmail-smtp-server "smtp.gmail.com")
     (smtpmail-stream-type starttls)
     (smtpmail-smtp-service 587)))

Is this a problem with the proxy? My settings (emacs or PIA)?


texts:
In gnome-terminal, the output of some commands is automatically "reflowed", in the sense that if the file tmp has content 0000000000 and the terminal has width 9, the output will be displayed as

$ cat tmp
000000000
0

but after resizing the terminal to more than 9 columns, the output of the above command (without running it again) will be displayed as

$ cat tmp
0000000000

In Emacs, doing the same test with ansi-term will leave the output unchanged after resizing the terminal buffer.

Is there any way that the buffer "saves" the output as a full line without cutting it first? The display of the full line would then be handled like a normal text buffer, supporting resizing and wrapping.


texts: How to show a message in the echo area not immediately but after a certain delay and to disappear it after a certain delay

texts:
The following show the message "something" in the echo area immediately, and this message remains there unless I do a second action (e.g. moving the cursor, executing anther command etc)

(message "something")

I would like that the message to not appear immediately, but after a delay of few second (say 2 seconds) and to automatically disappear after few second (say 3 second). Is this possible?

To be precise I would like that in the first delay of 2 seconds, I would able to see other system messages (if any).


texts: Tab key getting bounded to forward-button

texts:
Launching emacs with the -Q option (default settings) shows TAB being correctly bound to indent-for-tab-command. If I launch emacs without the -Q, TAB is always being bound to forward-button which is absolutely not what I want.

I've commented everything out of my ~/.emacs file and the problem is still persisting. What could be changing the TAB key behavior?


texts: Can I get whitespace-mode to display a sequence of two leading spaces , specially?

texts:
Like this:

I have been able to get whitespace-mode to display dots for leading spaces.

But I want to specially display each sequence of 2 leading spaces, with maybe a vertical bar.

Possible?

Maybe not with whitespace-mode?

As a separate question, how do I get whitespace-mode to display only leading spaces as middle-dot?

I have

    whitespace-space-regexp "\\(^ +\\)"

...but that seems only to apply to the FACE used, not to the character substitution.

I've been fiddling with this for 20 minutes. I'm amazed that I still have not cracked this. Doesn't everyone want something like this?


texts: Unable to call pyvenv-activate from init file

texts:
M-x pyvenv-activate <RET>
~/Documents/bitbucket-python-scripts/.env353 <RET>

works fine. Elpy Config buffer confirms that.

However with the following in ~/.emacs file

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)
(advice-add 'python-mode :before 'elpy-enable)
(elpy-enable)
(custom-set-variables
 '(elpy-rpc-python-command "python3")
 '(python-shell-interpreter "python3")
 '(pyvenv-activate "~/Documents/bitbucket-python-scripts/.env353"))

when I start Emacs and

M-x elpy-config

I see in the Elpy Config buffer that the virtual environment is  not set. custom-set-variables
were generated by Customization option of Emacs

Please point out my error.

Using:
Elpy 1.28.1
Emacs 24.5.1
Debian GNU/Linux 9.8 (stretch)

UPDATED

(pyvenv-activate "~/Documents/bitbucket-python-scripts/.env353")

In ~/.emacs just after (elpy-enable) properly activate the virtual environment .env353. I have no idea why custom-set-variable command (obtained through customization) doesn't work.


texts:
When flycheck runs when I am editing largish XML files (I believe it is just nxml mode), it tends to slow things to a crawl and then I have to kill emacs since C-g only works for a fraction of second. If I get the chance to turn flycheck-mode off after I open the file everything is fine.

How do I disable it while keeping the global flycheck mode on?

These answers are close but I don't know what to fill in for the latex stuff, nor were the instructions for figuring this out helpful:

Disable Minor Mode in Major Mode

Disable flycheck for laTeX


texts: What is the difference between emacs -Q -u [my-user] and emacs -Q -l [my-init-file.el]

texts:
I have all my emacs config in .emacs.d/init.el. The first command in that file is:
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

When I start emacs with emacs -Q -u [my-user] it works fine.
But when I start it with emacs -Q -l ~/.emacs.d/init.el I get the error Symbol’s value as variable is void: package-archives.
I know that I can add (require 'package) at the top of init.el to solve this problem. However, I'm trying to understand why I don't get that error with emacs -Q -u [my-user].
Besides I encounter other similar problems down the line with -Q -l ~/.emacs.d/init.el which are not present with -Q -u [my-user].
What could -u [my-user] load that is not in my ~/.emacs.d/init.el?
I had a look at The Emacs Initialization File and How Emacs Finds Your Init File. It lists several other possibilities for init files. None seems present on my system.
Specifically, none of these files exist:

~/.emacs.el
~/.emacs
~/.config/emacs/

I don't seem to have a site-wide default.el. Anyway the docs say that it would be loaded after my init.el so it would not explain why emacs chokes on the 1st line of that file.
I don't have site-start.el either. Confirming this, it makes no difference whether I append --no-site-file to the above commands.
In the Startup Summary I saw this:

It calls the function package-activate-all to activate any optional Emacs Lisp package that has been installed. See Packaging Basics. However, Emacs doesn’t activate the packages when package-enable-at-startup is nil or when it’s started with one of the options ‘-q’, ‘-Q’, or ‘--batch’.

I still don't understand why it works with -Q -u [my-user] and not with -Q -l [my-init-file].
I have GNU Emacs 27.1 built from source on Debian Buster.


texts: How to include other .org files programmatically (ie not from main .org file)?

texts:
Including other .org files is quite easy. For example, for configuration,

#+setupfile: /path/to/config.org

or

#INCLUDE: /path/to/config.org

Those lines need to be in the .org file in order to be processed.

How could one have a given #+setupfile and #+include file available programmatically at export time, without having to insert them in the file?

Practical use case: we need to batch process several hundreds org-mode files from a read-only repository. Those files do not have any #+setupfile and #+include file. For example, we need to make available a few #+MACRO lines (see below).

For each org-mode file, I could read it in a buffer, inject the needed #+setupfile and #+include, export the file, and go to the next.

Is there a simpler way, like for example setting #+setupfile or #+include as variables, so that they are automatically available at export time?

Perhaps there is a way to add something to .dir-locals.el?

We even though of using some elisp within org-load-hook or org-mode-hook, but I could not find a way to pass content that needs to be evaluated as active Org-mode.

Just to give an idea, this is a much simplified #+SETUPFILE:

#+OPTIONS: H:1 num:nil author:nil creator:nil timestamp:nil email:nil toc:t \n:nil @:t     ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:nil skip:nil d:t tags:not-in-toc

#+MACRO: fleuron @@latex:\fleuron@@ @@html:* * *@@
#+MACRO: newline @@latex:\\@@ @@html:
@@ @@ascii:|@@

#+LATEX_CLASS: book
#+LATEX_CLASS_OPTIONS: [a4paper,twoside,onecolumn]
#+LATEX_HEADER: \bibliographystyle{plain}
#+LATEX_HEADER: \bibliography{bibliography}


texts: After upgrading to Emacs 26, I have been having a problem when flyspell checks a document in Spanish. More precisely, flyspell doesn’t recognize accents and erroneously considers accented words like “musica” as two words (“mús” and “ica “). It doesn’t seem to be a problem with the dictionary, since I’ve made sure that the “castellano8” Spanish dictionary is loaded. Indeed, when I spellcheck the buffer (with aspell) it correctly recognizes accents. Does anybody know what changed with Emacs 26 (Emacs 25 didn’t have this problem), and how could this issue be resolved?


texts: org-capture buffer not showing schedule/deadline/time

texts:
If I use org-capture via C-c c t, I type in my headline (eg. "a new task") and press Enter, it takes me to a capture buffer, as expected. I can change the priority of the item there (eg. Shift-UP). However, if I try to add a schedule/deadline via C-c C-s/d, I get a calendar showing up nicely, and I can choose a date, but it doesn't show in the buffer itself. If I complete the capture via C-c C-c, the item itself in the org file has the scheduled date I chose, even though it wasn't visible in the capture buffer.
I'd like to be able to see the scheduled date in the capture buffer, so I can add time info to it (eg. 11:00) before refiling. Otherwise, I have to go locate it, and add that info.
This used to work for me, so I guess it's some package update thing... does anyone know why this is happening?
EDIT
Emacs version: 27.1
org version: 9.3
capture template:
(setq org-capture-templates
        `(("t" "Task" entry (file+headline "~/org/work.org" "Unfiled Tasks") "* TODO %^{Task}\n")
          ("n" "Note" entry (file "") "* %^{Note}\n" :immediate-finish t)
          ("i" "Interrupting task" entry (file+headline "~/org/todo.org" "Unfiled Tasks") "* STARTED %^{Task}" :clock-in :clock-resume)
      ("a" "Anniversary" entry (file+headline "~/org/calendar.org" "Birthdays/Anniversaries") "* %^{Anniversary}\nSCHEDULED" :imediate-finish t)
          ("j" "Journal entry with date" plain (file+datetree+prompt "~/org/journal.org") "%K - %a\n%i\n%?\n" :unnarrowed t)))

(NOTE: I notice this on the "t").


texts: How can I make `--verbose` flag be enabled by default in magit commit screen?

texts:
Right now, instead of pressing just cc in magit-mode, I have to press c-vc every time to enable --verbose.

Is it possible to make it enabled by default?


texts: Since update to org-mode 9.4 misaligned column view headers

texts:
I updated org-mode to 9.4. When I enter column view, the header is not in the correct size, so table columns are not below the respective header field.
I use different font sizes for different org-heading levels. But untill now in column-view everything was just the same font. Now it seems as if the lines inherit their respective org-level font size.
What does cause this and how can I make it return to normal proportions?


texts:
Adapting to a rather functional programming style, I often end up with files consisting of a lot of individual function definitions. Oftentimes, I then decide at some later point that I want to reorder those in some way as to facilitate understanding of the code, e.g. most general functions on top/ less general functions after, ...

At the moment I am mostly using manual killing and yanking to do this but find this rather cumbersome and time-consuming.

Is there a good (and maybe canonical) way in Emacs to do that? Ideally, I could call some command that presents me with a new buffer of all function names (one per line) and each change in that buffer would automatically update the order of the functions in my code-buffer (and vice-versa).

If only mode-specific solutions exist (which is probably all I can hope for since source code parsing is required) I would be interested in the following languages:

- Haskell
- Elisp
- Python


texts:
I want to use org-ref and org-download which provide convenient methods drag links into emacs to download the pdf file or image file. But following the config of the readmes, I still can not get both work. When I drag a url into emacs, it just insert a url of current buffer. I wonder whether this is a issue of specific version of emacs. I'm using the emacs-mac installed by brew. Any help will be appreciated. Thanks in advance!

P.s. I can find either a org-ref tag or org-download tag, so I tagged this as org-mode, sorry.


texts:
I am unable to set gofmt arguments to consume the following arguments
-tabs=false -tabwidth=2 -w=true
When I set the variable gofmt-args, I get the following error Invalid read syntax: "Trailing garbage following expression".
If I give just one argument such as  -tabwidth=2, I get the error Value ‘-tabwidth=2’ does not match type repeat of gofmt-args
Any suggestions on how to fix this?


texts: Disabling antialiasing for all letters including Greek

texts:
(On Arch Linux) run emacs -q and evaluate (set-face-font 'default ":antialias=false").
Your font should now not be smooth any more.  But type something with Greek
letters (οἷον ταῦτα): they will still be smooth.  Why?  And how can one turn off
antialiasing for all letters including Greek?

From describe-char on normal and Greek symbol respectively:

             position: 17192 of 43717 (39%), column: 0
            character: 1 (displayed as 1) (codepoint 49, #o61, #x31)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x31
               script: latin
               syntax: w    which means: word
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 31" or "C-x 8 RET DIGIT ONE"
          buffer code: #x31
            file code: #x31 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-PfEd-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x14)

Character code properties: customize what to show
  name: DIGIT ONE
  general-category: Nd (Number, Decimal Digit)
  decomposition: (49) ('1')

There are text properties here:
  org-category         "met"

[back]

             position: 17202 of 43717 (39%), column: 10
            character: λ (displayed as λ) (codepoint 955, #o1673, #x3bb)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x03BB
               script: greek
               syntax: w    which means: word
             category: .:Base, G:2-byte Greek, L:Left-to-right (strong), c:Chinese, g:Greek, h:Korean, j:Japanese
             to input: type "l" with greek-daedalus input method
          buffer code: #xCE #xBB
            file code: #xCE #xBB (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-PfEd-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x309)

Character code properties: customize what to show
  name: GREEK SMALL LETTER LAMDA
  old-name: GREEK SMALL LETTER LAMBDA
  general-category: Ll (Letter, Lowercase)
  decomposition: (955) ('λ')

There are text properties here:
  org-category         "met"

[back]


texts: How to list keybinding for a particular keymap (evil-mode)?

texts:
I am trying out evil-mode, and it seems promising. Now I would like to get an overview of the keybindings introduced in evil-normal-state-map. If I type C-h v RET evil-normal-state-map I get:

Value: (keymap
 (164 . evil-end-of-line)
 (mouse-2 . mouse-yank-primary)
 (18 . redo)
 (117 . undo)
 (remap keymap
        (yank-pop . evil-paste-pop)
        (cua-paste-pop . evil-paste-pop))
 (escape . evil-force-normal-state)
 (127 . evil-backward-char)
 (90 keymap
     (81 . evil-quit)
     (90 . evil-save-modified-and-close))
 (62 . evil-shift-right)
 (60 . evil-shift-left)
 (61 . evil-indent)
 (126 . evil-invert-char)
 (34 . evil-use-register)
 (64 . evil-execute-macro)
 (46 . evil-repeat)
 (27 keymap
     (46 . evil-repeat-pop-next))
 (67108910 . evil-repeat-pop)
 (20 . pop-tag-mark)
 (16 . evil-paste-pop)
 (14 . evil-paste-pop-next)
 (122 keymap
      (61 . ispell-word)
      (109 . evil-close-folds)
      (114 . evil-open-folds)
      (97 . evil-toggle-fold)
      (99 . evil-close-fold)
      (79 . evil-open-fold-rec)
      (111 . evil-open-fold))
 (103 keymap
      (44 . goto-last-change-reverse)
      (59 . goto-last-change)
      (126 . evil-invert-case)
      (63 . evil-rot13)
      (70 . evil-find-file-at-point-with-line)
      (102 . find-file-at-point)
      (85 . evil-upcase)
      (117 . evil-downcase)
      (119 . evil-fill)
      (113 . evil-fill-and-move)
      (74 . evil-join-whitespace)
      (105 . evil-insert-resume)
      (97 . what-cursor-position)
      (56 . what-cursor-position)
      (38 . evil-ex-repeat-global-substitute))
 (38 . evil-ex-repeat-substitute)
 (89 . evil-yank-line)
 (121 . evil-yank)
 (deletechar . evil-delete-char)
 (88 . evil-delete-backward-char)
 (120 . evil-delete-char)
 (83 . evil-change-whole-line)
 (115 . evil-substitute)
 (82 . evil-replace-state)
 (114 . evil-replace)
 (113 . evil-record-macro)
 (80 . evil-paste-before)
 (112 . evil-paste-after)
 (79 . evil-open-above)
 (111 . evil-open-below)
 (109 . evil-set-marker)
 (74 . evil-join)
 (73 . evil-insert-line)
 (insertchar . evil-insert)
 (insert . evil-insert)
 (105 . evil-insert)
 (68 . evil-delete-line)
 (100 . evil-delete)
 (67 . evil-change-line)
 (99 . evil-change)
 (65 . evil-append-line)
 (97 . evil-append))

How can I transform this into human-readable form? It would be nice if I could have the table in the format given by describe-mode, e.g.:

key             binding
---             -------

C-c             Prefix Command
C-d             elisp-edebug
  (that binding is currently shadowed by another mode)
ESC             Prefix Command
DEL             backward-delete-char-untabify

....


texts: How Can I Prevent make-process from failing if the default-directory doesn't exist?

texts:
Usually, when you open a file, Emacs prompts you to run M-x make-directory RET RET if the directory doesn't exist.

However, after writing my own advice, I realized that opening files in directories that don't exist was giving me a lot of errors. After digging a bit, I found that apparently make-process tries to set the current directory to the buffer's default-directory. Since it doesn't exist yet, it fails with an error saying that setting the directory didn't work.

Is there a way to prevent this, and still have the make-process command work? I looked at the keyword arguments, but I couldn't find any that would prevent the working directory from being set.


texts: Replace a two-line string not ending in digit with a one line string

texts:
I would like to replace a two-line string not ending in digit with a one line string. For example, replacing the following two-line string:

Extensions of the Single—Sa1e
Model 414

With a one line string:

Extensions of the Single—Sa1e Model 414

Using M-x replace-regexp.

My regex pattern to match is [^[:digit:]]^J, but I don't know how to capture the non digit part and then refer it in the replace string. How can I do this? Also, how can I specify the new line character?


texts: org-priority and org-insert-structure-template key binding clash

texts:
I'm using or-mode 9.2 and when I hit C-c C-, and I got the following message:

Before first headline at position 480 in buffer index.org

The message indicates that the key actually get translated as C-c ,, which maps to org-priority. I turn on M-x toggle-debug-on-error and see the following when I press C-c C-,

Debugger entered--Lisp error: (error "Before first headline at position 470 in buffer index.org")
  signal(error ("Before first headline at position 470 in buffer index.org"))
  error("Before first headline at position %d in buffer %s" 470 #<buffer index.org>)
  org-back-to-heading(t)
  org-priority(nil)
  funcall-interactively(org-priority nil)
  call-interactively(org-priority nil nil)
  command-execute(org-priority)

Does anyone run into issue like this?


texts:
Began here using Emacs SES mode for some spreadsheets, but seems by default to lack the grid lines to help locating the cells and its values.

Looks like it should be in some sort of hook in my .emacs file, but until now I don't know how to enable it.

Any idea?


texts: How to disable a hl-anything in orgmode?

texts:
I'm trying to disable hl-anything only when I'm using org-mode or org-agenda-mode but I don't know how to do it.

I have tried this:

(add-hook 'org-mode-hook
          (lambda ()
            (hl-highlight-mode nil)))

And this:

(add-hook 'org-agenda-mode-hook
          (lambda ()
            (hl-highlight-mode nil)))


texts:
I have disabled evil-mode in eshell by (evil-set-initial-state 'eshell-mode 'emacs) but when I switch windows(accidentally) using C-w k from eshell, evil-mode gets enabled.
How do I prevent this behavior?


texts: Switch desktops hotkey on Windows is not ignored by Emacs

texts:
The following keys:

Ctrl-Win-Left
Ctrl-Win-Right

are used to switch desktops on Windows.
If Emacs is the active window when you use either of these keys, you get the following in the minibuffer:

If you're using emacsclient, you may also have the taskbar icon flashing until you switch to that window:

One approach that seems to work to resolve this is adding the following to the init file:
(if (eq system-type 'windows-nt)
    (global-set-key (kbd "<C-lwindow>") 'ignore))

Is that the recommended approach for resolving this?
Is this issue considered a bug for Emacs on Windows? Should the above ignore-behaviour be the default?


texts:
I'd like to write Elisp code that compares text character by character between two buffers.

To do that, I need to first assign buffer names to the variables source-buffer and target-buffer respectively.

(defun set-source-buffer (&optional buffer)
  "Sets source-buffer to current-buffer. "
  (interactive "bSelect Source Buffer: \nr" buffer)
  (cond ((boundp 'buffer) buffer)
        (setq source-buffer (current-buffer))))

I would like to call this function by either activating the buffer to be selected as source and do (setq source-buffer (current-buffer)) or use (set-source-buffer buffer) in code, whereby buffer is the name of the buffer to be selected.

The above code returns nil when run on an active buffer.

How do I fix this?

Update:

I refer to the if statement provided by @Hubisan below.

(defun my-set-source-buffer (&optional buffer-or-name)
  "Sets `my-source-buffer' to `current-buffer' unless BUFFER-OR-NAME is given.
BUFFER-OR-NAME can be a string of an existing buffer or a buffer object."
  (interactive "bSelect Source Buffer:")
  (setq my-source-buffer
    (if (buffer-live-p (get-buffer buffer))
        (get-buffer buffer)
      (current-buffer))))

When should we use buffer-or-name for a variable and when to use just buffer alone?


texts: Chomp whitespace when autoclosing with smartparens?

texts:
electric-pair has an electric-pair-skip-whitespace config that accepts 'chomp to delete any whitespace between point and the matched closing delimiter. Does smartparens have something like that? I haven't found anything like that in the sample configs o wiki, but maybe it has a different name.

To clarify the behavior I'm looking for is:

{ abcd |
}

:=> type '}'

{ abcd }|


texts: package-install is "checking" a lot of files

texts: On running (package-install <some-pkg-name>), I am seeing a long list of messages of the form Checking /some/path/to/a/file. What are these checks that package-install does? How can I exclude certain locations that I see are irrelevant and have no .el files?


texts: Why does a theme change cause reloading - YASnippet

texts:
The problem:

Before installing YASnippet changing themes was instantaneous, now it YASnippet reloads itself in someway making changes take a few seconds.

Is this functionality necessary? Can I turn it off?

Is there some way around it?

Context:

I have this as part of my evil mode config:

;; Evil Mode Switcher
(defun toggle-evil-mode ()
  (interactive)
  (if (not evil-mode)
      (progn
        (evil-mode 1)
        (enable-theme 'ample))
    (progn
      (evil-mode 0)
      (enable-theme 'ample-flat))))

(global-set-key (kbd "<C-escape>") 'toggle-evil-mode)

It allows me to switch in and out of evil mode with C-escape.

While doing though it toggles to a darker theme, this makes it easier to recognise whether I am in it or not.

It used to work well, but now that I have YASnippet installed it takes too long.

Updated: Stack trace

Here is a slightly truncated stacktrace, by using debug-on-entry. From this it appears that yas is adding custom items to the theme, do they need to be updated though?

Debugger entered--entering a function:
* yas-reload-all()
  yas--global-mode-reload-with-jit-maybe()
  run-hooks(yas-global-mode-hook yas-global-mode-on-hook)
  yas-global-mode(1)
  custom-set-minor-mode(yas-global-mode t)
  custom-theme-recalc-variable(yas-global-mode)
  enable-theme(user)
  enable-theme(ample)
  toggle-evil-mode()
  call-interactively(toggle-evil-mode nil nil)
  command-execute(toggle-evil-mode)


texts:
When I start Emacs it asks me if I want to allow "unsafe" variables which I agree and press '!' to save them for the future. Despite that, it still keeps asking me about it on every launch.
Here is the code that I like to run a per-directory basis:
     (defun jarfar/org-tasks-refile-targets-local ()
       "Set local 'org-refile-targets for specific org files with tasks."
       (setq-local org-refile-targets
         `(
            (,my/org-backlog-file-path :maxlevel . 1)
            (,my/org-inbox-file-path :maxlevel . 1)
            (,my/org-tasks-file-path :maxlevel . 1)
            (,my/org-taxes-file-path :maxlevel . 1)
            )))

     (dir-locals-set-class-variables 'jarfar/org-agenda-dir-class
       '((nil . (
          (eval . (progn (jarfar/org-tasks-refile-targets-local)))
          ))))

     (dir-locals-set-directory-class org-agenda-directory 'jarfar/org-agenda-dir-class)

I tried many ways of suppressing this confirmation window but it keeps popping up.
Any idea?


texts:
I'm going through a LaTeX document fixing a bunch of broken references. I use AUCTeX. I ran TeX-toggle-debug-warnings to make TeX-next-error jump to warnings about references.

However, my document also has other warnings that I don't care about right now. So I compile, I press C-x `, and each time I get these two warnings before the interesting ones.

How can I tell AUCTeX to ignore specific warnings? (This question isn't about the \markboth/\markright warnings in particular, I expect to enter a regexp somewhere.) Either on a document by document basis, or in my init file.


texts: Org Mode. Set separation length between elements of a list

texts: I have noticed there is a big gap between the elements of a list when exporting to PDF. Is there a way to modify it?


texts: whitespace-mode doesn't show the space characters

texts:
I need to see the space characters but I can't set it for the life of me.

I went to customize the Whitespace Display Mapping and this is what I found. Notice that the mapping for the space is set to be ".". It doens't work of course:

INS DEL Character Mapping:
            Char Kind: Value Menu Space
            Char:
            Vector List:
            INS DEL :
                        Vector Characters:
                        INS DEL Char: .
                        INS
            INS
...

I even included this into .emacs

(setq whitespace-display-mappings '((space-mark 32 [46])
       (newline-mark 10 [36 10]) (tab-mark 9 [187
      9] [92 9])))

Still nothing.

Maybe someone know what is the problem here? I just want the whitespace overlay to show the " " character as a ".".

Thanks for your time and help in advance.


texts: How to set proper smtp Gmail settings in Emacs in order to be able to work with `M-x diary-mail-entries`

texts:
I tried the following settings in order to work M-x diary-mail-entries but it fails. My question is how to put the correct settings in order to be able to work with  M-x diary-mail-entries in Emacs.

(setq user-full-name "My name")
(setq user-mail-address "my_user_name@gmail.com")

(setq send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials
'(("smtp.gmail.com" 587 nil nil))
smtpmail-auth-credentials
(expand-file-name "~/.authinfo")
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587
smtpmail-debug-info t)
(require 'smtpmail)

I get the error

Sending via mail...
gnutls.c: [1] (Emacs) GnuTLS library not found
530 5.7.0 Must issue a STARTTLS command first. u9sm80344949wjy.37 - gsmtp
221 2.0.0 closing connection u9sm80344949wjy.37 - gsmtp
smtpmail-send-it: Sending failed: 530 5.7.0 Must issue a STARTTLS command first. u9sm80344949wjy.37 - gsmtp


texts: org-mode: search by regular expression in file

texts:
In org mode there is a way to create a link that will search for text in file./ For example:

[[./functions.pl::sub validate][sub validate]]

This will search for text "sub validate" in file "functions.pl". Unfortunately, there is another function in this file before "validate": sub validate_row.

And the search jumps to it. Can I set the regexp for "sub validate" so it jumped exactly to "validate"?


texts: How do I ensure org-sbe is consistently passed a string when copying tables

texts:
I'm trying to transform the data from one table to another however I can't do it with built in functions so I have to use org-sbe to call some elisp:

#+tblname: clues
|  02a8 |  0050 |  5012 |  2225 |  9555 |

#+name: hex-word-to-bitmap
#+begin_src emacs-lisp :var hex='02a8
  (let ((res "")
        (number (string-to-number (prin1-to-string hex) 16)))
      (while (not (= number 0))
        (setq res (concat (if (= 1 (logand number 1)) "1" "0") res))
        (setq number (lsh number -1)))
      (if (string= res "")
          (setq res "0"))
      res))
#+end_src

The end result is not every number is converted when I apply the following table formula:

#+tblname: hex-to-bitmap
| #ERROR | 1010000 | 101000000010010 | 10001000100101 | 1011110 |
#+TBLFM: @<$<..@>$>='(org-sbe hex-word-to-bitmap (hex (identity remote(clues,@@#$$#))))

I thought identity should pass along the data unmolested but I don't seem to be able to get it to work. What am I doing wrong?


texts: What does package-initialize do with package archives?

texts:
I'm reading through the definition of package-initialize to try and understand what goes on under the hood, and part of what it does is to read the package archive files. I see it comparing version numbers, but I don't fully understand what it's doing at a high level.

I'm looking at this method:

(defun package-read-archive-contents (archive)
  "Re-read archive contents for ARCHIVE.
If successful, set the variable `package-archive-contents'.
If the archive version is too new, signal an error."
  ;; Version 1 of 'archive-contents' is identical to our internal
  ;; representation.
  (let* ((contents-file (format "archives/%s/archive-contents" archive))
     (contents (package--read-archive-file contents-file)))
    (when contents
      (dolist (package contents)
    (package--add-to-archive-contents package archive)))))

I think it's being used to make sure that the packages we're loading also have their descriptors added to the package archives (e.g. .emacs.d/elpa/melpa-stable/archive-contents if they're not already in there. But I'm not clear on what these archive-contents files are used for, since running a command like package-list-packages communicates with the remote package archive.

I apologize if this question is a bit muddled, but I'm trying to push through the awkward early stage of learning emacs.

I should also probably mention that the reason I started investigating the internals of package-initialize was to figure out if there's some kind of lazy-loading that I could be doing, rather than loading everything as soon as emacs starts up.


texts: Starting emacs in daemon mode freezes, emacsclient is not able find a socket

texts:
I cannot launch the emacs daemon anymore. I do not know what triggered this.
When entering

emacs -Q --daemon -v

I get only the following and nothing happen.

Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Starting Emacs daemon.

Starting emacsclient -c returns:

 $ emacsclient -c
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

    --socket-name
    --server-file      (or environment variable EMACS_SERVER_FILE)
    --alternate-editor (or environment variable ALTERNATE_EDITOR)

I tried to update emacs without success. Do you know what is going on? How can I solve this?


texts: In Eclipse, I can hit CTRL + SHIFT + F which not only corrects the indentation but also whitespace (for example: c=a +b ; is corrected to c = a + b;) and the line length. I am looking for a similar tool for Emacs. All I know is C-x h TAB that corrects the indentation, but nothing more. Do you know any automatic way how to completely format a (espacially C/C++) source file in Emacs?


texts: Sum efforts in org-mode agenda, excluding specific tags

texts:
I use org-mode agendas to sum effort for a given day, so I know how much slack time I have in my schedule. However, I often have sub-trees in tasks that have been assigned to assistants (with the keyword "ASSIGNED"). I don't want to count the effort estimates for those tasks in my own effort estimates. However, I do want to keep the effort estimates for those tasks, since I generate separate reports for each of my assistants so I know how much work I've assigned to them.

I know it is possible to have column-view exclude archived tasks. However, archiving ASSIGNED tasks seems like a bad work-around! I also know how to exclude ASSIGNED tasks from my agenda. However, doing so does not affect the total time estimates I get using column-view on my agenda.

Is there a method of excluding tasks based on a tag or keyword from Effort estimates?


texts:
In c-mode, rust-mode, and similar major language modes, I frequently type something such as the following Rust:

if some_bool { Some(foo) } else { None }

As I enter this (| represents my cursor), electric-pair mode inserts matching brackets:

if some_bool { |}

Is there a setting that allows Emacs to insert matching space on the other side of the cursor following an opening character of a pair, so the above example would look like the following?

if some_bool { | }

I would expect it to behave exactly like additional parens had been inserted, and backspacing at this point should produce

if some_bool {|}

again.


texts: How to define a variable in a custom function?

texts:
I have a function for generating a new text file. The file is named automatically from date and time, following this format: yyyy-mm-dd--hh-mm-ss.txt.

However, I also need my function to insert the file name into the first line of the newly made file. The following code is not able to to this, since I am invoking dynamic date and time for both the file name and for the first line in the file. Hence, the text for the file name and for the first line differ by a second or two.

(defun myfun-create-file()
  "Doc-string."
  (interactive)
  (find-file-other-frame (format-time-string "C:/Users/me/notes/%Y-%m-%d--%H-%M-%S.txt") )
  (insert (format-time-string "FILE-ID: %Y-%m-%d--%H-%M-%S.txt\n")     )
  (save-excursion
))

How can I modify my function, by defining the file name first, as a text string variable, and then inserting this string both to the file name an to the first line of the file?


texts: How do I bind keys using general.el alongside evil?

texts:
My goal is to bind SPC SPC to counsel-M-x.
I've tried using this snippet from this post

(use-package general
 :ensure t
 :config
 (general-evil-setup t)
 (general-define-key
  :states '(normal visual insert emacs)
  :prefix "SPC"
  "SPC" '(counsel-M-x :which-key "M-x")
   )
  )

I don't see any errors when I evaluate this snippet but it's not taking an effect, how should I proceed?


texts: how to start daemon with `--debug-init` or equivalent debugger?

texts:
summary

problem

I'm trying to debug a problem that involves an Emacs config and daemon startup. But when I run

emacs --daemon --debug-init

from a console, the spew ends with

Loading desktop from /home/me/.emacs.d/personal/ ...
Entering debugger...

and hangs until killed. How to make the daemon properly enter the --debug-init (or other) debugger?

current workaround

Take YoungFrog's advice:

0. Consider emacs --daemon --debug-init to be broken WRT this usecase. (TODO: file emacs bug.)

1. Start sessions with emacs --debug-init (and not emacs --daemon --debug-init).

2. Debugger will work: use it to resolve all startup problems.

3. Once session will load without error with emacs --debug-init, return to starting sessions with emacs --daemon.

detour

Another late-night brainfart :-( I had tried to run

$ emacs --daemon --debug-init

(as later recommended by phils) and got the response

emacsclient: unrecognized option '--daemon'

Next morning I realized

$ alias emacs
alias emacs='emacsclient -c -a emacs'

and therefore that I needed to run (in bash)

$ \emacs --daemon --debug-init
# ^--note backslash needed to override the alias

which works ... except that it gives the problem described in section=summary.

details

reproduction procedure

I'm running the GNU Emacs 24.4 GUI via daemon on a vanilla Debian stable=Jessie with minor bits of testing (none involving Emacs). I'm rebasing my old'n'crufty, non-package-using emacs config on Prelude as follows:

1. Old config (also a git repo, but private) is @ ~/.emacs.d__old_n_crufty/

2. New config (a Prelude fork) is @ ~/.emacs.d__Prelude/

3. When I want to check my old functionality, I do

pkill emacs                  # ensure daemon not running
rm ~/.emacs.d
ln -sr ~/.emacs.d__old_n_crufty ~/.emacs.d
ls -ald ~/.emacs.d*          # sanity check
\emacs --daemon --debug-init # backslash to override alias

4. I copy bits of elisp from my old config to the new, then test latter with

pkill emacs
rm ~/.emacs.d
ln -sr ~/.emacs.d__Prelude ~/.emacs.d
ls -ald ~/.emacs.d*
\emacs --daemon --debug-init

Just to be excruciatingly clear: both configurations are running the same underlying Emacs version, and both are using daemon+emacsclient. The only difference is the configs, i.e., the runtime ~/.emacs.d/.

Old'n'crufty config works as expected: particularly, the spew in the console in which I run my startup scriptlet ends with

Desktop: 1 frame, [much too large number of] buffers restored.
Starting Emacs daemon.
Restarting server
Emacs daemon should have started, trying to connect again
Waiting for Emacs...

and then I see my GUI frame. New config was doing fine until I ported my desktop; now, console spew ends with

Loading desktop from /home/me/.emacs.d/personal/ ...
Entering debugger...

which hangs until C-c. (Note also that both configs are using the exact same desktop file: 2 copies in different filetrees, no symlinks involved (yet, anyway).)

How to make the daemon start/enter the --debug-init debugger properly? Alternatively, is there another debugger that plays better with the Emacs daemon, but which does not require major labor?

workarounds

starting without daemon, i.e. just oldschool emacs --debug-init &. See this "answer", or section=current workaround above (to which I'd link but SE apparently won't support section links).

failed options

unalias emacs. I thought, maybe starting the debugger might involve calling emacs, and be getting hosed by my alias. Empirically, no change.

deprecated options

Recompiling Emacs with debug symbols. That seems like a lot of work.
Bisecting config. This is unnecessary, because I've been porting function from old'n'crufty config to Prelude-based config step-by-step, and I know exactly what is failing: it's loading my old desktop. What I want to investigate is,

exact same Emacs version used for both cases
exact same desktop file used for both cases
old'n'crufty config can load that desktop with no error
Prelude config hangs entering debugger with that desktop


texts:
In lispy-mode, I want to use control + the arrow keys instead of lispy's defaults (h, j, k, l).

But if I run the obvious code

     (define-key lispy-mode-map [C-up] 'lispy-up)

then C-up always calls lispy-up.  This is unlike lispy's defaults, which are only available when one is right next to a parenthesis.

How do I make control + the arrows to operate exactly as h, j, k, l?


texts: How to check for emacs being initialized in daemon mode?

texts:
I use emacs gui in daemon mode and also in standalone terminal mode. There is a package that I just want to use when I'm using emacs in terminal mode.

the problem is that I can't use (display-graphic-p) because when I run emacs --daemon the initialization system thinks that I have no graphic-display, but I'll have when I connect the emacsclient to the daemon.

I wish I had access to a function like this:

(if (emacs-initiating-in-daemon-mode)
    (my-setup-for-gui)
    (my-setup-for-terminal))

Is that possible?


texts: Emacs Not Responding on launch on Mac OS X

texts:
My Emacs 24.5.1 is not responding frequently recently on my MacBook Pro Yosemite 10.10.3. I have installed it from emacs for mac osx. Emacs window does not open, it shows Not Responding in the Activity Monitor. Sometimes it launches successfully without all these symptoms.

What can be the reason for this? Is the latest version of the Emacs is buggy for mac or there is a different known reason for that?


texts: Can `helm-ag` commands ignore git submodules?

texts:
When I am running helm-ag commands in a large project with multiple git submodules, the shared libaries are repeatedly searched. I do not want those be searched.

So how can I change the helm-ag commands' behavior to achieve that?

The helm-ag library I mentioned above is here:
https://github.com/syohex/emacs-helm-ag


texts: Make ITEM in org columnview contain summary [/]

texts:
I have a set of tasks (TODOs), split into sub-tasks.  I have 3 TODO states e.g. started, in-progress, and done.
As per the org manual the parent TODO can be made to show DONE - on setting of all children to DONE, and progress of completed sub tasks can be monitored by adding [/] to the parent ITEM.
When I export this with columnview I don't seem to be able to bring the [/] into the ITEM in the table.  I can kinda get around this either by having a separate column for checkboxes which I can then summarise using using {X/}, but my table is already very wide and an extra column feels like noise.
Instead I'd like to have the [/] included in the in the parent TODO column , but as eg [1/2] is not a valid TODO type this obviously doesn't work.  I can get around this by removing the TODO from parents and using the summary status below.
(defun org-columns--summary-status-count (statuses _)
    "Summarise statuses with a Complete cookie."
    (print statuses)
    (format "%d/%d"
        (cl-count-if (lambda (b) (string-equal b "DONE"))
             statuses)
        (length statuses)))

This is OK, but it what would be nicer would be would be to include the [1/2] in the ITEM rather than the TODO.
To do this I can write a collect function similar to this - to collect from a different column:
Org mode column view dependent columns?
Something like this:
(defun org-collect-confirmed (property)
  (let ((prop (org-entry-get nil property))
    (confirmed (org-entry-get nil "TODO")))
    (if (and prop (string= "DONE" confirmed))
      "1"
      "0")))

Then my summary function would need to sum-up like org-columns--summary-sum, but also concatenate the parent ITEM and the [final sum / length of collection].  So the collector would have to return count on TODO and the string of the property.
My questions are:

Am I over-complicating this - is there a simple way of included the [/] in ITEM of columnview?
Assuming "No" to question 1.  How do I extract the parent ITEM string from the property?  I seem to be constrained by the fact that the COLLECT function must return a string rather than a tuple to represent both the ITEM and TODO columns AND that there is no way of knowing the level of the property in the heirachy in the SUMMARIZE and COLLECT functions as defined in org-columns-summary-types?

For more context current full document and code is here - I make a summary type named "C+" which uses the workaround above which is OK, but not ideal:
https://raw.githubusercontent.com/falloutphil/Misc/master/cpd.org


texts: Always use default as input to describe-symbol function

texts:
I want to map describe-symbol to shortcut, but I constantly have to press additional enter for show describe on found default suggestion. Is there a way to force emacs to newer ask for confirmation with enter on describe-symbol call?

P.S. Maybe there's a way to do this from elisp function call? I use that wrapper function to get symbol under cursor description, how shoult I tweak it to make it works as I wish?

(defun sandric/hydra-dash (arg)
  "Hydra help dash"
  (interactive "P")
  (call-interactively 'describe-symbol arg))


texts: How do I escape special characters in Org mode?

texts:
Here is a bit of Org code:

Here's a bit of OCaml: ~let x' = 1 in x' + x'~.
Many ~x~s in there, no?
And this one is worse: ~x ~!~ x <> 0~

Exporting to PDF yields this:

How do I

Escape the ' to fix the first line?
Escape the s to fix the second line?
Escape the ~ to fix the third line?

I did not find any mention of this is the org manual.


texts: interactive shell and C compilation inside emacs

texts:
I compiled a simple program in C (it does the sum of 2 numbers), by doing :

M-x compile RET
gcc -dummy.c -o dummy
M-x shell RET
./dummy

I get a prompt for the first number I can enter, then nothing is happening. I mean I can enter the first number, do RET, enter the second number (even though I don't have the prompt for this one) and I can get the result with Ctrl-D.
So, very ugly.
Any idea what is happening under the hood and what I should do to improve that?
Thanks

here is the code :

int main()
{
    int nb1,nb2;
    printf("please enter nb1");
    scanf("%d \n", &nb1);
    printf("please enter nb2");
    scanf("%d \n", &nb2);
    printf("the sum:");
    printf("%d + %d = %d", nb1, nb2, nb1 + nb2);
    return 0;
}


texts: Can I export latex source blocks to html?

texts:
I love that I can insert raw LaTeX fragments in my Org files, and the HTML exporter handles them automatically (either leaving them for MathJax to display, or processing them to images).

I'm working on a file where I want to wrap my fragments in src blocks—#+BEGIN_SRC latex / #+END_SRC—mainly for ease of tangling them all together.  Unfortunately, the HTML exporter—after processing these to #+BEGIN_LaTeX / #+END_LaTeX—now skips right over them.

I realize this is by design, per the manual on quoted latex code, but I’d like to switch it up for this particular file.  Is there a setting I can configure?  Alternatively, which function should I advise to get the behavior I want?


texts: Make mark color overlap highlight symbol at point

texts:
I use auto-highlight-symbol-mode package to auto highlight symbol on point. I found it annoying when I mark a text because the symbol highlight overlaps on my marked text, so I don't see if I marked what I want to mark already.
I have no attachment to auto-highlight-symbol-mode package or anything else, I just looking for a way to have a auto highlight symbol functionality overlapped by text mark background color.
Any solution?


texts:
I would like to use 2-space indents all the time like:

sidekiq_options({
  retry: true
})

I've tried setting .emacs.d/init.el to:

(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq indent-line-function 'insert-tab)

(setq ruby-deep-indent-paren nil)
(setq ruby-deep-indent-paren-style nil)

But I still get stuff looking like:

sidekiq_options({
                  retry: true
                })


texts: How to define action to happen on triple key press?

texts:
I'm using evil mode.

I'm looking for a convenient way to type German language Umlaut characters (ä, ü, ö, Ä, Ü, Ö, ß) while using an English US keyboard layout.  One idea that came to mind was to have triple key presses insert these characters, e.g., pressing aaa would insert ä, OOO would insert Ö, SSS would insert ß, and so on.

This should of course only happen while in insert state.

Unfortunately, I have no idea how to accomplish this - any help is greatly appreciated!


texts: How to show trees from archive files by default (a.k.a. (org-agenda-archives-mode 'files))?

texts:
I want my default agenda view to include archived trees from .org_archive files.
From the manual we learn:

  v a     (org-agenda-archives-mode)
  v A     (org-agenda-archives-mode 'files)
  Toggle Archives mode. In Archives mode, trees that are marked ARCHIVED are also scanned when producing the agenda. When you use the capital A, even all archive files are included. To exit archives mode, press v a again.

However, when I (org-agenda-archives-mode 'files) I get the following error at startup:

Symbol's function definition is void: org-agenda-archives-mode

How can I get the default-agenda to include archived trees?


texts: Define a function that jumps outside paired delimiters (including braces, parens and quotes)?

texts:
I have this Vim command to jump outside any parentheses or quotes or double quotes or bracked, when you're inside a closed region. When I press jj fast, it allows me to jump outside the closed region:

inoremap jj <Esc>/[)}"'\]>]<CR>:nohl<CR>a

Note that the regular expression begins after <Esc>. I was missing this in Emacs.

I decided to give a try with the following:

(key-chord-define evil-insert-state-map "jj"
  ;; Escape from capsuled string
  '(lambda ()
     (interactive)
     (forward-char 1)
     (insert " ")))

For example, * is the place of the cursor.

This is an another "example of a string *" within this sentence

Pressing the jj fast allows me to jump outside the string inside the sentence.

2 questions:

1. It's only working if the cursor is on the last character before the quote. And not in middle for example. How to solve it?

2. How get it working for single quotes ('), brackets '}', or parentheses ())?.

Any suggestion would be really appreciated.


texts: Prevent text jumping up the screen when dismissing Swiper

texts:
Swiper creates a minibuffer many lines in height.  This height is borrowed equally from my existing, vertically-arranged, windows.  When Swiper is dismissed, this space is recovered by the windows and they all grow slightly, moving down the screen as they do so.

The consequence of this is that the text that I've just searched for jumps down the screen.  I find this jarring, and would like to prevent it from happening.  Any ideas?

The documentation suggests that setting window-combination-resize to nil should do what I want, but this is already set to nil; it seems that either this doesn't apply to minibuffers, or something is preventing it from taking effect in this case.


texts: Org-export: How to filter table of contents entities

texts:
This is a follow-up question from this: Replace \LaTeX command in HTML export
Consider following org-mode file:
* Text about exporting from org-mode to \LaTeX

text

* Text about exporting from org-mode to HTML

another text

If I export this file to HTML and also use filter to replace "\LaTeX" in heading with simple "LaTeX", I end up with table of contents entries that still contain "\LaTeX" as a string, instead of the replacement "LaTeX."
I should also add that I am using Doom Emacs and I am running Emacs in non-interactive session through makefile (I am doing multiple exports to multiple export formats).
Looking to org-manual about TOC, I could use property ALT_TITLE (org TOC), but because I am exporting also to LaTeX, that would mean I would lost formatting in there.
I reused filter fom linked question:
(require 'ox)
(require 'ox-html)

(defun my-latex-filter-example (text backend info)
  "Replace \LaTeX with \"LaTeX\" in HTML output."
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string "\\\\LaTeX" "LaTeX" text)))

(add-to-list 'org-export-filter-link-functions
             'my-latex-filter-example)

According to optons listed in manual: Advanced Export I have also tryied plain-text and options org-export-filter-functions, but none were able to remove string "\LaTeX" from HTML table of contents.
Is there a way to target with filter functions links generated by TOC in HTML?


texts: Indent javascript arrow functions like regular anonymous functions

texts:
Using Emacs 25.1 and js-mode for javascript editing.

Is it possible to change the indention rules in js-mode to customize the indention of arrow functions?

Example of anonymous function indention:

const x = list.map(function (x) {
  return someCoolFunction(x)
    .maybeEvenAChain()
    .or(two)
})

How I would like arrow functions indented:

const x = list.map(x =>
  someCoolFunction(x)
    .maybeEvenAChain()
    .or(two)
)

This is what emacs is doing right now:

const x = list.map(x =>
                   someCoolFunction(x)
                   .maybeEvenAChain()
                   .or(two)
                   )

UPDATE:

I have looked through the indention code of js.el, and there seem to be two reasons arrow functions are not indented like anonymous functions.

If an opening paren, square or curly brace has any text to the right all the text inside will be indented to the column of the first word after the opening punctuation. Also, the closing punctuation will be indented to the same column of the opening punctuation.
This is the desired behavior for object literals and the argument list of both function definitions and calls.
This functionality is defined in js--proper-indentation
If an exception is made for the arrow operator => to resolve the first issue, a second issue arises. The arrow operator is considered a continued expression by js--continued-expression-p. The body of the arrow function will indented to (* 2 js-indent-level). This aligns the body with any actual continued expressions inside the body, which looks pretty messy.

I am still pursuing a comprehensive way to resolve the issue.


texts: How to make *Messages* use visual-line-mode?

texts:
I'd like to use visual-line-mode in the *Messages* buffer. I can switch to that buffer and run M-x visual-line-mode, but I want to configure it automatically. I've tried adding this to my init.el, but it's not taking effect:

(add-hook 'messages-buffer-mode-hook #'visual-line-mode)

I've also tried this, hoping it would apply visual-line-mode to *Messages* and *Warnings*, but again, no luck:

(add-hook 'special-mode-hook #'visual-line-mode)

Maybe it's adding the hook after the messages buffer has already been initialized? Is there a correct way to do this?


texts: Run Emacs command from terminal and terminate

texts:
Is there a way to open a file on emacs, execute a command and quit, quietly?
I tried

emacs file --eval '(progn (cmd) (kill-emacs))'

But if I execute this, emacs shows up briefly before quitting. Is there a better way?


texts:
I'm relatively new to Emacs and org-journal and I'm wondering if I'm doing something wrong or if this is the intended behaviour of org-journal.

When creating a journal entry with C-c C-j the current window is split. Entering data works, but I somehow expected to go back to the window configuration before when finishing the entry like in org-mode (C-c c and C-c C-c). Currently the split remains and when doing another C-c C-j the journal file opens in the other split. So in the end I'm toggling between two splits.

Edit: testing this on Emacs 24.5.1 on Windows, using org-journal 1.9.6


texts: How to quickly create a new directory without using dired-mode?

texts:
Whenever I've to create a  new directory in emacs, I enter dired mode, press "+" and enter the new directory name which creates the new directory.
Is there a way I can avoid using dired-mode and create a new directory in the current path of the active buffer like creating a new file using C-x C-f command ?


texts: Using Prettify Symbols with strings instead of characters

texts:
I want to the prettify-symbols-mode functionality, but using strings instead of chars as visual replacements:

;; typical replacement for chars
(push '("lambda" . ?λ) prettify-symbols-alist)

(defun my/add-visual-replacement (whatwith)
  ;; answer to my question
  ;; maybe do something with `prettify-symbols-alist'
)

;; usage
(with-current-buffer "micódigo.py"
    (my/add-visual-replacement '("print" . "imprime")))

so, with cursor outside of the replacement, shows the string replacement:

def mifunción():
  mivariable=1█
  imprime(mivariable)

But will show the true string when the cursor is on it:

def mifunción():
  mivariable=1
  █rint(mivariable)

Best approach that I'm trying to understand is using reference-point-alist (as was done here), but I don't fully understand it.


texts: org-clock-report not updating current day values

texts:
I am very recently working with time tracking in org-mode.

When I make do org-clock-report, it reports well.

I edited the top line to display features per date and C-c C-c:

#+BEGIN: clocktable :maxlevel 3 :scope file :step day :tstart "<-4d>" :tend "<now>" :compact t

So that I can see the info for the last four days sorted by date.

My problem is until the day finishes the stats don't add up and show. For example today is August 6th and this is what I have despite having clocked 4 + hours. It will display this properly tomorrow.:

  Daily report: [2019-08-06 di]

  | Headline     | Time   |

  |--------------+--------|

  | Total time | 0:00 |


texts:
I am using emacs 24.4 in Org-mode and try to narrow/widen to/from subtrees using C-x n s and C-x n w, repsectively. However Widening is not working and once I have narrowed down to a particular subtree I am stuck there until the next time I visit the file. I would appreciate any thoughts to resolve the issue.

PS: complete beginner here.

Solved: My bad; I failed to scroll up after widening, it was there, I just couldn't see it.


texts: How can I startup Spacemacs with several windows?

texts: I'd like to have two windows opened (vertical split) after startup of Spacemacs. How do I have to configure .spacemacs?


texts: auctex and pdf-tools reverse search change keybinding

texts: Inverse search from pdf-tools to auctex uses Ctrl-click on the pdf file to go to the corresponding part of latex file. Is it possible to also assign Alt-click to do inverse search? I am using ubuntu 18.04 (in case the OS is relevant).


texts: Why is ESS causing my emacs to start so slowly?

texts:
For some reason (which I can't understand, I did not change anything) emacs has become very slow - as in 2 min - at startup. I traced it down to the require commands of ESS. This is what I have in the .init file:

(setq load-path (cons "/usr/share/emacs/site-lisp/ess" load-path))
(require 'ess-site)
(require 'ess-smart-underscore)
(setq ess-default-style 'DEFAULT)

ess-smart-underscore also loads ess-site so eliminating the first require does not change anything. From this question I tried to use eval-after-load, but this does not work:

(eval-after-load 'ess-smart-underscore)

In general, I don't care to have ESS loading at startup. I'd be happy if it only loads when I open *.R or *.r files, but I'd like a reasonable startup time.
I am running emacs 24.5.1 and ESS 16.04 on Linux. Downgrading to the previous versions of either did not make a difference.

I have now commented everything in .emacs except for:

(setq load-path (cons "/usr/share/emacs/site-lisp/ess" load-path))
(require 'ess-site)

Then I have reinstalled emacs, ESS, R and updated all the R packages: no difference. I noticed, however, that the first time emacs is launched it is a little bit faster then the following times, which seems odd to me.


texts:
I'm trying to setup a lint for javascript files.

Here's the relevant setup I have.

(use-package
  js2-mode
  :ensure t
  :init
  (progn

    (add-to-list 'auto-mode-alist '("\\.js?\\'" . js2-jsx-mode))
    )
  )

(use-package
  flycheck
  :ensure t
  :init
  (progn
    (add-hook 'after-init-hook #'global-flycheck-mode)
    (setq flycheck-highlighting-mode 'lines)

    ;; https://github.com/mooz/js2-mode/issues/292

    (defun setup-js2-mode ()
      (flycheck-select-checker 'javascript-eslint)
      (flycheck-mode))

    (add-hook 'js2-mode-hook #'setup-js2-mode)
    (add-hook 'js2-jsx-mode-hook #'setup-js2-mode)
    )
  )

also I know emacs can find eslint

M-: (executable-find "eslint")
"/home/eugenekim/.nvm/versions/node/v6.4.0/bin/eslint"

But I get no errors with flycheck-list-errors when I deliverately make errors on *.js files

Also I found the following weird. (not sure relevant)

M-x flycheck-select-checker (enter) javascript-eslint

Can’t use syntax checker javascript-eslint in this buffer


texts: How can I add/subtract vectors by Calc in Org-mode?

texts:
I want to add/subtract two vectors, X and Y in Calc.

If I calc constant numerics within Org-mode source block, it's o.k.

#+BEGIN_SRC calc :session *Calculator*
[1,1] + [2,2] + [3,3]
#+END_SRC

#+RESULTS:
: [6, 6]

#+BEGIN_SRC calc :session *Calculator*
[3,3] - [2,2] - [1,1]
#+END_SRC

#+RESULTS:
: [0, 0]

#+BEGIN_SRC calc :session *Calculator*
[1,10,100] * [10,100,1000]
#+END_SRC

#+RESULTS:
: 101010

Applying Calc within Emacs Lisp source code block in Org-mode is o.k.

#+BEGIN_SRC emacs-lisp :results value scalar :exports both
(setq X '[1 2])
(setq Y '[3 4])
(calc-eval (format "%s+%s" X Y))
#+END_SRC

#+RESULTS:
: "[4, 6]"

On the other hands, If I try in Calc source block with variables , it fails.

#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]
X+Y
#+END_SRC

# (wrong-type-argument number-or-marker-p [1 2])

Add can be done strangely with further extra brackets,

#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]
[X]+[Y]
#+END_SRC

#+RESULTS:
: [[4, 6]]

but fails in subtraction.

#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]
[X]-[Y]
#+END_SRC
# (wrong-type-argument number-or-marker-p [3 4])

How can I add/subtract vectors by Calc in Org-mode source code block ?


texts: automatic latex-preview-pane with auctex and or-mode latex export

texts:
To enable automatic latex-preview-pane-mode with AUCTex I bound it to a hook:

(add-hook 'LaTeX-mode-hook 'latex-preview-pane-mode)

This works.
When I open a *.tex file, then latex-preview-pane-mode gets enabled.

BUT: now when I export a org-mode file via latex to pdf (C-c C-e l o) two times (or more often), then the latex-preview-pane window (aka DocView or pdf-tools) is also opened a second time. My frame then shows on both windows the generated pdf. The bad thing is, it breaks auto-revert of the pdf-preview (the pdf-view does not get updated to changes anymore).

(removing the above hook, repairs org-mode's latex export. But then latex-preview-pane-mode gets not automatic enabled from within AUCTex)

Question:
How can I have latex-preview-pane-mode enabled automatically and working with both AUCTex and org-mode's latex export?

Note: I have seen 2 similar named questions here, but those have a complete different topic.
Note: I added (add-to-list 'revert-without-query ".+\\.pdf$") for auto-revert of pdf files to my init.el.


texts: Is it possible to export an org table into an interactive table?

texts: Org-mode can nicely export tables into html customly. However, these exported tables cannot be sorted or filtered (i.e. are not interactive). Would it be possible to make these tables sortable and filterable?


texts:
I am a beginner in org-mode (and Emacs, for that matter), but I thought that org-mode would be a good place/format to store my contacts. One thing I like to do is to add birthdays to contacts. I found org-contacts.el, which appears to have what I want: I add a person in contacts.org and add a birthday property.

* Ficitive Person
:PROPERTIES:
:EMAIL: fp@example.com
:BIRTHDAY: 2000-09-24
:END:

Now in another file (agenda.org), I have the following:

* Birthday
%%(org-contacts-anniversaries)

When I press C-c a a (M-x org-agenda-list), I see their birthday and how old they are, cool!

However, for some people I know their birthday, but not their age. Still I'd like to see that it is their birthday on my calendar, but when I enter a birthday in any other format, I get an error:

Bad sexp at line 24 in [...]/org/agenda.org: (org-contacts-anniversaries)

Is there a format for inserting birthdays without knowing the year?

Like I said, I am an emacs noob, so if there is another better way than org-contacts (or org-mode, for that matter) I am happy to learn that way.


texts: how to end macro expansion in *scratch* buffer and return to writable buffer

texts:
In scratch buffer, Emacs can expand macros(C-c e; macrostep-expand).
But once I expanded the macro, it seems to become a read-only buffer.
I don't know how to end macro expansion and return to writable buffer.
It would be very helpful if you could tell me the solution.
My environment is below.

GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
WSL2

Thanks
EDIT
macro-expansion is a function of macrostep.el.


texts: Org-mode verbatim tilde (=~=) is still processed by Latex back-end

texts:
I have some verbatim text containing a tilde, =some ~ text=. Now, org-mode is supposed to leave the tilde alone. However, upon exporting with the latex backend, I get the following in my .tex: \texttt{some \textasciitilde{} text}, which is not the same, as it is rendered as a "high" tilde versus a centered tilde.

Now, in normal text I can work around this by some Latex command that forces the centered tilde. However, this is inpossible in verbatim, as commands do get translated to Latex as-is, so it would say \texttt{some \midtide text} instead.

Anyone that knows why this is? A solution would be to insert =@@latex:~@@= which is some "super-verbatim" that actually does just plop in the tilde, however this only works on the Latex backend. As I also export to HTML I would like to keep my document as backend-unaware as possible.


texts: Can I hack org-mode to not visually modify links in headers?

texts:
Sometimes I put links in the header title of an org document. Org mode automatically re-colors and underlines the links. I would like my links that appear in section titles to appear unaltered. Is this possible?

For example I'd like the first header of the following document to look like the header section.

Is this possible?


texts: Org-mode: Source block doesn't respect parent buffer indentation

texts:
When I edit a source block it comes out in the org-mode buffer like this:

- Item 1
  Text indented two spaces here under list entry

  #+BEGIN_SRC ruby
class Name
end
  #+END_SRC

But it should be indented like this:

- Item 1
  Text indented two spaces here under list entry

  #+BEGIN_SRC ruby
  class Name
  end
  #+END_SRC

How do I need to configure org-mode to solve this issue?


texts: Ask for confirmation before deleting repeating tasks in org-agenda views

texts:
By customizing org-agenda-confirm-kill, I am able to get confirmation when I kill a task in an agenda view. I can set this to t to always ask for confirmation (which I don't want to do, because I usually just kill one off tasks instead of marking them DONE), or to a number n so that I have to confirm when a TODO spans n or more lines. I currently have this set as follows:

(setq org-agenda-confirm-kill 2)

This will prevent me from accidentally removing a TODO with notes or other information that I am not seeing when in agenda view. However, I am also worried about accidentally deleting repeating tasks. Is there any way to get confirmation in the agenda views before killing repeating tasks?


texts: how to include instructions within the enumerate in orgmode latex export?

texts:
I can't seem to find this case in the documentation and it doesn't seem to fit the LATEX_ATTR options. How can I get orgmode latex export to produce the following (note the setlength statements WITHIN the enumerate block)?
\begin{enumerate}
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}}
\item first
\item second
\item third
\end{enumerate}


texts: Font Size (Face Attributes, Height) in Org Mode's Column View

texts:
Happy New Year!
I use Org Mode and columnview extensively.  The issue I am having is that zooming (Command + on MacOs or C- + on PC) doesn't work in column view.  Here is an example before zooming in

Now, here is the view after zooming in (using C- + on PC and CMD + on Mac.

You can clearly see text from the property drawer enlarged and the text from the columns unchanged.
I have looked at the face attributes in column view using C-u C-x = to get

The right-hand buffer with the face information is

I cannot quite figure out where to go from here.  I thought about clicking on the line

 ((:foreground unspecified) (:height 120 :family "Menlo") org-column org-level-2)
which brings up

Clicking on  (customize this face) at the top brings up

Clicking on  brings up this menu

Checking Height and using 2.0 instead of 1.0 and hitting Apply blows up the font of the headers.  I need to increase the font size of the text in the column cells.  Anybody knows how to do this?


texts: Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path

texts:
C-hfnormal-top-level-add-subdirs-to-load-pathRET gives:

  (normal-top-level-add-subdirs-to-load-path)

  Recursively add all subdirectories of ‘default-directory’ to
  ‘load-path’. More precisely, this uses only the subdirectories whose
  names start with letters or digits; it excludes any subdirectory named
  ‘RCS’ or ‘CVS’, and any subdirectory that contains a file named
  ‘.nosearch’.

I am trying to use the package f which has prerequisites the packages s and
dash. I want to load f.el with use-package, so I downloaded the four packages with git into a custom folder: ~/.emacs.d/installed-from-github/.

I recognized that after cloning with git the folder names of the first three packages became dash.el, s.el, and f.el. Note that each folder name contains a dot. But according to the documentation for normal-top-level-add-subdirs-to-load-path given above it should work for these type of directory names. However,
 when I try to run emacs with the following init file:

(setq debug-on-error t)
(let ((default-directory  "~/.emacs.d/installed-from-github/"))
  (normal-top-level-add-subdirs-to-load-path))
(message "%S" load-path)
(require 'use-package)
(use-package dash
  :demand)
(use-package s
  :demand)
(use-package f
  :demand)

I get the following error:

Error (use-package): Cannot load dash

and when I inspect the *Messages* buffer I can see that load-path does not contain any of "/home/hakon/.emacs.d/installed-from-github/dash.el", "/home/hakon/.emacs.d/installed-from-github/s.el", or "/home/hakon/.emacs.d/installed-from-github/f.el".

Also, since if I change the directory name of dash.el to dash-el it seems to work fine, I suspect the problem is with the dot in the directory name.


texts:
I'm used to the artist-mode and though it work decently, i was wondering if it was already possible (with builtin or external library) to draw SVG, either with the mouse, or any other method beside using elisp code to construct it.

I'm aware of a couple project that generate SVG on github, but most if not all construct it with elisp, which isn't really what i want.(while i want to draw it in emacs using either the mouse or keyboard like artist-mode does).


texts: Running lsp-mode with Python using the pyls from the virtualenv of my project

texts:
I wish to run LSP using the pyls from the virtualenv of my project.

I don't have pyls installed globally (only in the local virtualenv).

I found this snippet online:

  (lsp-define-stdio-client lsp-python "python"
                           #'projectile-project-root
                           '("pyls"))

However the function lsp-define-stdio-client has been deprecated.

I can enable lsp with python-mode, and when opening a python file, I get a message saying LSP :: No LSP server running for python-mode (which is expected), then run:

(lsp-register-client
 (make-lsp-client :new-connection (lsp-stdio-connection "/path/to/my/project/bin/pyls")
          :major-modes '(python-mode)
          :server-id 'pyls))

And finally run lsp from the buffer containing the python file.

However I would like this to be done automatically (when I open a python file, emacs finds the corresponding pyls and runs it).

Is there a way to do this?


texts: Using org-protocol with a floating capture window?

texts:
I have recently found a way to have a floating capture window, with this setting I can create a floating capture window using:

emacsclient -n -e '(make-capture-frame)'

My knowledge of elisp and org-mode internals being close to 0, I did not find a way to have the same behaviour via the org-protocol. What I would like is that when a call happen using the org-protocol, I have a nice floating capture window in front of me.

Note that I'm not attach to use this specific code to create a floating capture window, but that is my current starting point.

Here is the code I'm currently using:

;;;
;; Capture floating frame
;;
;; taken from: http://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml
;;;

(defadvice org-capture-finalize
    (after delete-capture-frame activate)
  "Advise capture-finalize to close the frame"
  (if (equal "capture" (frame-parameter nil 'name))
      (delete-frame)))

(defadvice org-capture-destroy
    (after delete-capture-frame activate)
  "Advise capture-destroy to close the frame"
  (if (equal "capture" (frame-parameter nil 'name))
      (delete-frame)))

;; make the frame contain a single window. by default org-capture
;; splits the window.
(add-hook 'org-capture-mode-hook
          'delete-other-windows)

(defadvice org-switch-to-buffer-other-window
  (after supress-window-splitting activate)
  "Delete the extra window if we're in a capture frame"
  (if (equal "capture" (frame-parameter nil 'name))
      (delete-other-windows)))

(defun make-capture-frame ()
  "Create a new frame and run org-capture."
  (interactive)
  (make-frame '((name . "capture")
                (width . 120)
                (height . 15)))
  (select-frame-by-name "capture")
  (setq word-wrap 1)
  (setq truncate-lines nil)
  (org-capture))


texts: How to properly indent application in scheme-mode?

texts:
The scheme-mode indents application in this way:

(define (x)
  (x 1
     2))

But when the function to apply is the result of another application scheme-mode indents the code this way:

(define (f)
  ((f) 1
   2))

But I would like to indent this in the same way as the first.

(define (f)
  ((f) 1
       2))

How can I achieve this?


texts:
I have spacemacs and a problem I have compared to using terminal+vim is that I could do everything in the terminal : create files, directories, whatever and whenever I need to edit a file I just type vim file. Now to use spacemacs I basically have to tab to exmaces and type the path to the file I want to edit.

So I think you would need to console inside emacs, is there such service ?


texts: Why does point move after executing this function from keybinding

texts:
I have the following line in my init.el:
(define-key
  org-mode-map
  (kbd "C-c C-p")
  (lambda () (interactive) (org-publish-project "publish-website"))
  )

The "publish-website" argument points to an element of my org-publish-project-alist.  This works as expected, except that it moves my point to the start of the buffer when I execute it (which is very annoying).  I have two questions (thanks in advance for your help):

What am I doing wrong here?
How do I fix it?


texts: Working with tramp mode on slow connection, emacs does network trip when I start typing

texts:
After some pause (a few seconds) of idle I start typing and emacs does some network activities and because of my slow connection this looks like everything is slow and hanging all the time. I disabled all extra modes but this still happens, any idea what is going on?

UPDATE

This is what i get in tramp debug buffer:

21:57:55.654206 tramp-do-file-attributes-with-stat (5) # file attributes with stat: /home/u/f.htm
21:57:55.654709 tramp-send-command (6) # echo are you awake
21:57:57.373233 tramp-wait-for-regexp (6) #
are you awake
///966dcbf73a99f3becae06a545679cb59#$
21:57:57.373649 tramp-send-command (6) # ( (test -e /home/u/f.htm || test -h /home/u/f.htm) && (\stat -c '((/////%N/////) %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 /////%A///// t %ie0 -1)' /home/u/f.htm | sed -e 's/"/\\"/g' -e 's/\/\/\/\/\//"/g') || echo nil) 2>/dev/null; echo tramp_exit_status $?


texts: How to keep indented under plain list items in org-mode

texts:
While regular paragraphs are happily indented under plain list items (using [SPACE] bar to indent the first line takes the rest along with) I have noticed that code blocks do not like to cooperate. Is there any way to fix this?

Right now, this is what I have:

- [ ] My plain list item

  Nicely indented paragraph, blah blah blah blah blah blah blah blah
  blah blah blah blah blah blah blah blah blah blah blah blah blah blah
  blah blah blah.

  #+BEGIN_SRC elisp
; Uncooperative code block -> notice that only the first line indents.
(lambda () (do-something-amazing))
(blah-blah-blah)
#+END_SRC

I would like to get this:

- [ ] My plain list item

  Nicely indented paragraph, blah blah blah blah blah blah blah blah
  blah blah blah blah blah blah blah blah blah blah blah blah blah blah
  blah blah blah.

  #+BEGIN_SRC elisp
  ; Happily indented code block -> notice that all code follows with :)
  (lambda () (do-something-amazing))
  (blah-blah-blah)
  #+END_SRC


texts: ido flex matching doesn't seem to work, or works partially

texts:
I'm running emacs 24.5.1, with the built in ido-mode. I enable (setq ido-mode-flex-matching t) and (ido-mode 1)in my startup file, and ido matching (at least the prefix and substring types of matching) work fine in the minibuffer.

But "flex matching" (as I understand it, perhaps incorrectly) should allow me to type "psw" to match a file named Pro-Something-Windows or program-swift-wings.

I've tried combinations such as psw, p-s-w, etc, but without success. Am I doing something wrong, or do I understand flex matching incorrectly? I've search the net, youtube, SO, and various IDO articles and help files, but came away with nothing (except youtube demonstrated the matching behavior that I don't get with my setup...)  Thank you


texts: Emacs theme not covering up the entire terminal window. The Ubuntu purple terminal background is showing on the edges

texts:
At the bottom of the screen when emacs is open there is a strip of purple, meaning that emacs in terminal isnt maximizing to the full size that the terminal window allows and thus the background from the terminal is showing. I know this is nit-picky but my OCD is driving me crazy. Anyway to fix this?

I would post an image but I don't have enough stack karma points yet.


texts:
I want to have:
- a source code block fontified on export
- but not executed
- and used as input for another source code block.

I can have it fontified in org-mode and not exported if I use a begin_example block. But can I let it be fontified on export (to html or latex) es well? Or, vice versa, can I suppress a begin_src from being executed?

What I have so far is this:

#+name: uninterpreted_sh
#+header: :exports code
#+begin_src sh
echo "Direct"
#+end_src

#+name: uninterpreted
#+begin_example sh
echo "Direct"
#+end_example

#+header: :exports both
#+header: :results output
#+begin_src sh :stdin uninterpreted
VALUE=$(cat)
echo "I got: $VALUE"
#+end_src

#+RESULTS:
: I got: echo "Direct"

There I can get uninterpreted_sh fontified and can use uninterpreted as stdin.

A last resort might be to supress the begin_example from beeing exported altogether?

Note: ther results I get from the last source block is exactly what I want.


texts: Whitespace-mode characters: customise mapping of printable character representations

texts:
The whitespace-mode has a default mapping from whitespace characters to printable characters:

U+0020 → U+00B7 “·”
U+0009 → U+00BB “»”
U+000A → U+0024 “$”
etc.

How can I change which printable characters are used for each whitespace character? For example, to show “⇒” or “¶”.

I'm using Emacs 24.5.1.


texts: How to a create keybinding to open a particular file?

texts:
How to change the SPC m c (org-capture) keybinding to open the ~/capture.org file instead?

F-5 opens file when this is in .spacemacs file:

(global-set-key (kbd "<f5>") (lambda() (interactive)(find-file "~/capture.org")))

My failed attempt to bind SPC m c:

(global-set-key (kbd "SPC m c") (lambda() (interactive)(find-file "~/capture.org")))

got this error:

Key sequence `SPC m c` starts with non-prefix key `SPC`

I am using Emacs 25.2.1 with Evil Spacemacs and Ivy on Linux.


texts: How can emacs org-mode execute shell code remotely as sudo?

texts:
My self-documenting maintainance scripts, where I document how systems have been setup, I need to execute stuff as sudo/root and want the results automatically added to the document. But for safety reasons on the target system root has login disabled. I have to connect via an admin-user, which then can sudo stuff.

in my emacs init.el this adds bash execution:

;; allow org mode bash execution
;; --------------------------------------
(org-babel-do-load-languages 'org-babel-load-languages '( (shell . t ) ) )

Then in my document I have e.g. this bash / shell piece:

#+BEGIN_SRC bash :dir /sudo:adminuser@fresh_installed_computer:~/ :results output
parted /dev/sda "unit GiB" "print free"
parted /dev/sda "unit s" "print free"
#+END_SRC

The error message is:

Host 'fresh_installed_computer' looks like a remote host, 'sudo' can only use the local host.

See Org-Mode Manual: 15 Working with Source Code

Using Debian Stretch with Emacs 24.5.1 on the local machine, the remote machine is about to become debian buster fresh install.

UPDATE

When executing

#+BEGIN_SRC bash :dir /ssh:adminuser@fresh_installed_computer|sudo:fresh_installed_computer:~/ :results output :session
echo "user $USER"
#+END_SRC

The status line holds "Opening connection for root@fresh_installed_computer using sudo... \" and then waits forever

Interestingly: when I add the actual IP address like this, it suddenly works as expected:

#+BEGIN_SRC bash :dir /ssh:adminuser@fresh_installed_computer|sudo:XXX.XXX.XXX.XXX:~/ :results output :session
echo "user $USER"
#+END_SRC
#+RESULTS:
: user root

ssh to adminuser@fresh_installed_computer and there pinging works, so name resolving is up.

ping fresh_installed_computer

Any explanation, or do I need to stick with magic number fixed ip adress in my document?

UPDATE 2

The issue with resolving hostname vs IP adress
could be solved by clearing tramp proxy caches:

M-x tramp-cleanup-all-connections
M-: (setq tramp-default-proxies-alist nil)

Now all works fine! Thx


texts: how to define color for part of a comment?

texts:
How to make colored some part of comment? Let comment be ;; This is James Bond diary. And I want to make "James Bond" in green.

There will be only a few such strings and no places where it will be repeated, so it is OK to define exact symbols-insertion in dot-emacs file.


texts: How to fold all org blocks under the current header line?

texts:
Q: how do I hide all org-mode blocks under the current
header?

I want to fold all source code blocks under the current heading
only.  I know that I can use org-hide-block-all to fold
all blocks in the buffer, and org-hide-block-toggle to toggle
the current block (i.e., the one at point).  But how about all
blocks under the current heading?

For example:

* header 1
   #+name: block-1
   #+begin_src R
     x <- 1:10
   #+end_src
   #+name: block-2
   #+begin_src R
     y <- 1:10
   #+end_src
   #+name: block-3
   #+begin_src R
     z <- x + y
   #+end_src
* header 2
   #+name: dont-fold-me-1
   #+begin_src R
     a <- "puppies"
   #+end_src
   #+name: dont-fold-me-2
   #+begin_src R
     b <- "kitties"
   #+end_src

I'd like to be able to fold all blocks under header 1 but leave
the rests of the blocks (under header 2) alone.  How would I do that?


texts:
I am having problem with inserting diary block entries into my calendar. In the homepage i read that i b starts a block entry, pressing i b on the calendar mode however i see No mark set in this buffer in the echo erea. I also tried M-x and then diary-insert-block-entry in the calendar mode, got the same error.
Can anyone help?


texts: shorten or control the length of url link in org mode without bitly packages

texts:
I have very long url,  for example,  https://www.youtube.com/channel/UCGM8KgUXqsS4d8-4rgWRWKg/playlists, how can I tailor it into a shorter form?

Like : https://www.youtube.com/channel/UC... [here ... means there are still content here]
Remarks:

There is a package called bitly, but I don't want to use;
I do know this [[link][description]] stuff, I just want to display url.

Anyone has any ideas? Thanks!!!


texts:
In Emacs, where is ispell's personal dictionary stored?, the documentation http://www.gnu.org/software/emacs/manual/html_node/emacs/Spelling.html says

  Your personal dictionary is specified by the variable ispell-personal-dictionary. If that is nil, the spelling program looks for a personal dictionary in a default location.

But where is this default location?  In general, how to find out this?


texts:
I'm beginner in spacemacs (and emacs) and I've tried to install sonarlint.
I've found a way to install in emacs, this https://github.com/emacs-lsp/lsp-sonarlint,
but, how can I install this in spacemacs? maybe there is a general way to install MELPA packages, but I don`t know.


texts: How to make linked word in org-beamer stands out?

texts:
I am using org-mode with Beamer.
Using the Barkeley theme, I wrote something like this:

To [[http:www.google.com][Google]]

However, the outputed slide doesn't indicate any hint of the word "Google" being a link:

How can I make the word "Google" stands so that the viewer knows that it is clickable and will bring the user to a web page?
Maybe there is a variable that dictates org-mode on how to
convert an org-mode link to a Latex one that I can edit.


texts:
When calling a helm selection function like helm-multi-files I get a helm buffer looking like this:

Buffers
templates       755       Dired by name  (in '/path/to/dir->
text.md        1320       Markdown       (in '/path/to/fil->

Recentf
/path/to/file/text.md
/scp:me@myserver:/home/

If I want to create my own version of, say, helm-multi-files, how can I customise the lines with the buffer info?

For example I want to modify on which column the buffer mode info  (eg. "Dired by name") is printed. Or I want to get rid of the buffer size info (e.g. "755").

Do I have to use some attributes when constructing the helm source (defvar my-helm-source-....)? Or do I have to customise the function which uses this source (defun my-helm-list...)?

Also, long-line truncation for this helm buffer is switch on (resulting in the "->" at the end of the line), how can I switch it off when constructing my own version of this function?


texts:
When I do something inside Emacs, with the buffer *Messages* you get some idea what happened. But it's only if that function is echoing a message for the minibuffer. Then *Messages* keeps a record of messages that are echoed.

I remember there was a buffer where all commands were listed that are executed. But I cannot find it back in the Emacs documentation. It displayed also functions that are not echoing any message at all.

Do anyone know about which function I'm talking?


texts: fr is not inserting \frac{}{} in CDLaTeX

texts: I typed fr<TAB> as is written in the manual but got only a fr and a tab. The \frac{}{} is not correctly inserted and so does sq. Why is this happening?