texts:
I'm new to Emacs. Been a vim user.

Using M-x customize-face, irrespective of what font I set it to, Emacs always ends up using Inconsolata-g for Powerline font. Default is DejaVu Sans Mono. I tried removing .emacs.d directory as well as emacs (package itself), but neither helps.

Here's what I do:

M-x customize-face default
Set it to, say, Ubuntu Mono Regular
Hit Apply and things look good
So I hit State and choose option #1 which stores it to ~/.emacs (for fresh install; I use ~/.emacs/init.el instead - not sure which is better of two)
C-x C-c
Start emacs again and the font is set back to Inconsolata-g for Powerline

How do I get rid of what I'm seeing on step 6 here? I saved ~/.emacs to ~/.emacs.d/init.el and here are its contents:

$ cat .emacs.d/init.el
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "PfEd" :family "Ubuntu Mono Regular")))))


texts: How do I set the mode-line to display using multiple lines, as required (or even statically), to fit in all of its contents?


texts: Defining advice for cider-interactive-eval for evil compatibility

texts:
Cider offers very useful debugger for clojure code. Once you enter the debugger, you can step through it with keys like (n)ext, (o)ut, etc., like so. Using evil, the problem is that if I enter this debugger in normal-state, those keypresses will never make it to cider-debug, as evil interprets them according to its own keymap.

One way to reconcile this would be to automatically enter insert state when cider-interactive-eval (how you enter the debugger) is called and cider--debug-mode is active.

Here's how I imagine it would be, but it doesn't work yet. How can I improve this?

(defadvice cider-interactive-eval (after enter-insert-for-dbg activate)
  "When cider-eval takes you to a dbg session, enter insert-state."
  (when (and (bound-and-true-p cider--debug-mode)
             (eq evil-state 'normal))
    (evil-insert 1)))

(ad-activate 'cider-interactive-eval)


texts: Is it possible to debug Django from gud-pdb?

texts:
Brand new to gud/pdb and I am trying to run the Django development server from emacs. I can't seem to set breakpoints that affect the running server, though.

I am invoking PDB with M-x pdb, then running it like python -m pdb manage.py runserver —noreload

Once gud-pdb buffer fires up, I can type c or r and the server starts up. I can access the server from a browser and server logs are output into gud-pdb buffer (At this point, I lose the (pdb) prompt, for what it’s worth.. until I kill the server). Here's what the output looks like:

Current directory is ~/dev/proj/
2  > /Users/ms/dev/proj/manage.py(3)<module>()
3  -> import os
4  Breakpoint 1 at /Users/ms/dev/proj/proj/app/models.py:393
5  (Pdb) r
6  Performing system checks...
7
8  System check identified no issues (0 silenced).
9  January 05, 2018 - 13:55:24
10 Django version 1.11.8, using settings 'proj.settings'
11 Starting development server at http://127.0.0.1:8000/
12 Quit the server with CONTROL-C.

I can visit files in my project and set breakpoints and they are logged in the gud-pdb buffer (at least until I start the server) but the breakpoint doesn’t seem to have an effect when I visit the view in question in the browser.

I've seen some indication this is possible in various forums but documentation on this use case is scant. I am running GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0) from Homebrew on a MacBook.

Any suggestions?


texts: on Mac, scroll-down or scroll-up don't move point to very top/bottom

texts: I'm fairly new to the Mac, and I've started using Emacs. I've noticed that the scroll-down command, bound to Meta-v, works okay to scroll the visible portion of the buffer, except that it doesn't move point to the very top of the buffer, the behavior that I'm used to in Windows. Nor does Ctrl-v move point to the very bottom of the buffer. Why is this, and how can I change it to match Windows?


texts: Magit: Getting to the current/editable version of a file from a commit/diff view

texts:
Very similar to this question, particularly the second part to this answer:

From the diff view of a specific commit, is there a way to jump to the current+editable version of a modified file? If I press RET on the file, Magit takes me to a read-only view of that file from that commit; is there a simple way to instead jump to the current version of that file so I can edit it?

(My current workflow is to use find-file-in-project to load the file but it'd be so much faster if I could directly navigate to it via Magit.)


texts:
I have installed yasnippet, and confirmed that the minor mode is active, but I can't seem to trigger expansions.
This is in my init.el file:
(add-to-list 'load-path
             "~/.emacs.d/packages/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)

(setq yas-snippet-dirs
      '("~/.emacs.d/snippets"                 ;; personal snippets
        "~/.emacs.d/snippets/yasnippet-snippets.el"
        ))

When I edit an org-mode file, for instance, and type img  then TAB, nothing happens.  I can't get any snippets to expand.  Am I missing something?


texts: How do I filter an alist to just the properties I care about?

texts:
To effectively use a service's API, I'm leveraging json-read to turn the JSON response into an understandable data structure:

(let ((json-object-type 'alist)
      (json-array-type  'list)
      (json-key-type    'symbol)
      (json-false       nil)
      (json-null        nil))
  (json-read))

This works great, but gives me a bunch of garbage that I don't care about.

I want a function keep-structure that works through this alist and filters out all of the junk:

(keep-structure '((owner login) name)
                '((owner (login . "octocat") (avatar . "blah"))
                  (name . "Hello-World")
                  (some-url . "https://some-domain")
                  (stars . 42)))

;; => ((owner (login . "octocat"))
       (name . "Hello-World"))


texts: Password/Key Management for multiple machines in emacs

texts:
I log into numerous machines as part of my job (+- 20 per day). I only spend a few days/weeks with each machine. Many run ftp only.

For seamless access Tramp is amazing, but it is the managing of these server's access by hand that has become tedious.

I manage a .netrc and a .ssh/config by hand, along with any keys. Often a password/key will change during my time with the machine, and I will have to re-edit the files.

Is there an effective solution for managing (machines/passwords/keys) from within emacs?


texts: Searching Greek and Hebrew texts in Emacs with isearch while ignoring accents and diacritics

texts: I have a number of text and org documents that contain Greek and Hebrew text. I want to be able to search these in Emacs using isearch but I also want Emacs to ignore all accents and diacritics. I found a solution to this problem years ago but forgot what it is. Any help would be appreciated.


texts: Exporting a file from ORG MODE automatically changes my numbering

texts:
I have several ORG files which I wish to export to HTML or ODT from emacs. These files have specific numbering. However when I export them the numbers are automatically adjusted. For example in the file I would have the following numbers:

ויאמר = ordered.
ילדים - the object of ויביאם (verse 3).
לחסד ולרחמים - ל in both instances marks a second object.

After export, these numbers appears as 1. 2. 3.

How can I change this?


texts: I want to re-install spacemacs, since something doesn't work and I don't want to spent on fix it. But how to backup the bookmarks of the spacemacs, even better also backup the most recent open file list.


texts:
As of now, org-mode always adds a \centering into the Latex export for figures. This makes my figures appear centered. But I want them to be alligned to the left. For tables, some suggested using :center nil. But there is no such thing for figures. Someone else suggested modifying an elisp variable but I looked and there is no such variable. If I add :float nil then \centering is removed but this ignores captions as well. So how can I make Latex export not add \centering before \includegraphics by default? I want to retain captions.

If I manually edit resulting tex file and remove \centering, I get my images as intended. But this time caption stays centered, only the image moves.


texts:
I am trying to get js-mode to highlight a "shebang" (#!/usr/bin/env node) as a comment, but my code is not working. Instead, the entire buffer is colored like a comment. I've read the documentation for modify-syntax-entry carefully but am still not getting anywhere.

I have tried these calls and several similar combinations, but without success:

(modify-syntax-entry ?# "< 1" js-mode-syntax-table)
(modify-syntax-entry ?! "< 2" js-mode-syntax-table)


texts: The `org-set-effort` fn has changed behavior on Emacs 28? How to select an effort by index typing 1, 2, 3 etc.? instead type the entire value?

texts:
I was using Emacs 26 and put this line on top of my org-mode file:
#+PROPERTY: Effort_ALL 0:25 0:50 1:15 1:40 2:05 2:30 2:55 3:20 3:45 4:10 4:35 5:00 5:25 5:50 6:15 6:40 7:05 7:30 7:55 8:20

This means how much "pomodoros" (25 min each) I'd like to make as an effort prediction. When I pressed C-c C-x e (aka M-x org-set-effort) I could type like 1, 2, 3, 4... until 9 to say that I want like "1 pomodoro", "2 pomodoros", "3 pomodoros" and so on.
After upgrade my Emacs to version 28 now I cannot type the number as index. I should type the entire value, like 0:50, for example. I could not type 1, 2 etc. anymore. Why not? What have changed and what can I do to back the previous behavior?
Thank you.


texts: How to disable diff-hl when browsing remote files?

texts: When using Tramp and while browsing remote files diff-hl hangs Emacs. How is it possible to disable this package only when accessing remote files?


texts: Emacs Mode For Editing Guitar/Bass Tablature?

texts: I have been looking for a while, and have not been able to find an Emacs major mode for editing Guitar/Bass tablature.


texts:
I found that yasnippet suggests using this code to limit it to only expand when the trigger text has just been typed:

(setq yas-expand-only-for-last-commands 'self-insert-command)

Unfortunately when I add it to my config, yasnippet no longer expands. My guess is that some other command is being run right after I insert text, and thus the self-insert-command is not the most recent command. Yasnippet says it can take a list of different commands, so how can I check what commands follow a self-insert-command (or just a list of all commands) to try to have yasnippet work with them?


texts:
This is similar to (this question).

I would like to export the following org-mode document to LaTeX:

* Test
  text 1
  text 2
  text 3

  - list 1
  - list 2
  - list 3

  #+BEGIN_definition
  environment 1
  environment 2
  #+END_definition

I want to preserve the line breaks to achieve a tex document looking like:

\section{Test}
text 1\\
text 2\\
text 3

\begin{itemize}
\item list 1
\item list 2
\item list 3
\end{itemize}

\begin{definition}
environment 1\\
environment 2
\end{definition}

i.e. I would like to append \\ after each line preceding regular text (for example, it should not be appended before a blank line, \item, or \end{...}).

I can almost achieve this using #+OPTIONS: \n:t but this appends \\ to each line, not just lines preceding regular text. Are there simple ways to achieve this? What configuration settings should I try to play with?


texts: Send process output to *Messages* buffer, but bypass the echo area

texts:
Is it possible to send the output from a process-filter to the *Messages* buffer and suppress that message output from appearing in the echo area, such that I am able to simultaneously use interactive commands without having the minibuffer-prompt being erased by the ongoing subpress filter output?

(defun rsync-process-filter (proc string)
  (when (not (or
      (string-match "files...\r" string)
      (string-match "files to consider\n" string)))
    (message "%s" string)))

EDIT (January 3, 2015):  The following is a link to a similar question, however, I have not yet been able to make it work with a process string where the exact string is unkown -- the title of the thread is: Emacs - Disable Some Minibuffer Messages:

https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages


texts: ESS hooks breaking buffers not associated with files

texts:
This is a weird one, for me: I use both ESS (for R programming) and gist.el for (surprise!) interacting with github gists. Except, now I have a problem: every time I try to view a gist locally, ESS's R hook tries to read the dir of the gist, which is nil, and explodes:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  directory-file-name(nil)
  ess-r-package--find-package-path()
  ess-r-package--local-package-info()
  ess-r-package-get-info()
  ess-r-package-auto-activate()
  run-hooks(after-change-major-mode-hook)
  run-mode-hooks()
  fundamental-mode()
  normal-mode()
  gist-fetch("3116a156329746b082d9")
  gist-fetch-current()
  funcall-interactively(gist-fetch-current)
  call-interactively(gist-fetch-current nil nil)
  command-execute(gist-fetch-current)

So that's pretty cool. Adding to the general sense of bewilderment: this happens on any gist, regardless of what major mode it should end up in. (I assume this is some deep ESS black magic trying to determine if it should leap in to action or not.)

So I'm trying to figure out:

Is this a bug in ESS? Sure seems like a bug, but I don't actually grok the core behavior of ESS in this instance, so I'm not sure.
Whether it's a bug or not, any suggestions on a work-around?


texts: Weird behavior of defmacro and intern - symbolp error

texts:
I have the following macro

(defmacro test-macro (arg)
  `(defun (intern (concat "test-func-called" ,arg)) ()
     (message "I do nothing")))

When I call to this macro

(test-macro "test")

It gives me the following error

Wrong type argument: symbolp, (intern (concat "test-func-called" "test"))

Evaluating the following gives me t

(symbolp (intern (concat "test-func-called" "test")))


texts:
I'm aware of and use whitespace-mode to great effect. I don't show a glyph/character for spaces because I think it's too noisy and unnecessary. I do highlight trailing spaces red which is great.

Aside from that, I was thinking that it may be useful to specify a glyph such as ·, if it were possible, for inner consecutive spaces. This means that it excludes trailing whitespace as well as indentation, for example:

print("one·····two");

instead of:

print("one     two");

But again, this wouldn't apply to leading/indentation whitespace nor trailing whitespace.

Is this possible?

EDIT: I tried setting whitespace-regexp-search as:

(setq whitespace-space-regexp "[^ ]\\( \\{2,\\}\\)[^ ]")

I have spaces and space-mark in my whitespace-style:

(setq whitespace-style
      '(face indentation trailing empty spaces space-after-tab
        space-before-tab tab-mark space-mark))

However, it seems like the whitespace-space-regexp is only for the spaces face highlighting, and isn't used for setting the space-mark. Here's the effect:

Notice that all other spaces are still showing the space-mark, even though what I'd like is for consecutive spaces of 2 or more to show it. The inner consecutive spaces are indeed being highlighted differently, but I only did that to show the difference between what's being matched by whitespace-space-regexp and the space-mark character.

In fact I just noticed that even the numberline is showing the space-mark.

It looks like the space-mark is simply matched based on a character, which I guess makes sense, so perhaps this isn't possible after all.

Note: As outlined in my post, I recognize that this isn't possible via whitespace itself, what I'm curious about is whether it's possible to do at all. I found some uses of font-locking such as this one which accomplish replacing pattern matches with a character. I'm wondering if it would be possible to use something like this but have it replace the spaces in the region matched with the middle dot for example.


texts: Auto-load Ivy.elc failed to define swiper

texts:
I get the followingerror message:

command-execute: Autoloading file /home/user/.emacs.d/elpa/ivy-20210506.2157/ivy.elc failed to define function
swiper

after just having installed emacs 27.2 and having this init.el:
;General Configuration
(setq inhibit-startup-message t)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
(set-fringe-mode 10) ;was macht das?

(menu-bar-mode -1)
;;Set up the visible bell
(setq visible-bell t)

(load-theme 'wombat)

;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)

;; Initialize package sources
(require 'package)

(setq package-archives '(("melpa". "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")
                         ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(require 'use-package)
(setq use-package-always-ensure t)

(use-package command-log-mode)

(use-package ivy
  :diminish
  :bind (("C-s" . swiper)
         :map ivy-minibuffer-map
         ("TAB" . ivy-alt-done)
         ("C-l" . ivy-alt-done)
         ("C-j" . ivy-next-line)
         ("C-k" . ivy-previous-line)
         :map ivy-switch-buffer-map
         ("C-k" . ivy-previous-line)
         ("C-l" . ivy-done)
         ("C-d" . ivy-switch-buffer-kill)
         :map ivy-reverse-i-search-map
         ("C-k" . ivy-previous-line)
         ("C-d" . ivy-reverse-i-search-kill))
  :config
  (ivy-mode 1))

I have only one ivy folder in my load path.
Does anybody have an idea?


texts: How do I clear all marks from the current buffer mark ring?

texts: Newbie here, but oddly I couldn't find an answer to this by Googling.  How do I clear all marks from the current buffer?  I did find how to view the mark ring, but not how to clear all marks from current buffer.


texts: How can one configure orgalist-mode to be able to cycle through numeration schemes?

texts:
In org-mode and in the defunct orgstruct++-mode, one can cycle through enumeration schemes via Shift-Right-Arrow. For instance, from
   1. toto
   2. titi

to
   A) toto
   B) titi

This does not seem to be supported by default in orgalist, the proposed replacement of orgstuct++-mode. Is there an option to configure in order to support it?


texts: how to set ranger to be default mode in dired in Doom emacs?

texts:
I'm new to doom emacs and I like it but I'm still new, so I saw this package called ranger that is a minor mode inside emacs and I want to make it run by default whenever I open dired. The documentation says set this variable ranger-override-dired-mode t, but I don't know where to start.
I tried to add this in ~/.doom.d/config.el but it crashes when launch emacs
can you please guide me !!


texts:
I want to use hydra (in Emacs 24.5.1 on Windows 10) to create a pop-up list of directories that I often use. Selecting one of the directories in the list, using a single key, should cause it to open in Dired.

For example, the plan is that once the hydra menu is active hitting "a" will open in "g:/foo/bar/grob" and hitting "b" will open "c:/longername/short/utilities/morestuff/utilities" and so on.

I have run into difficulties with something I thought would have been obvious, namely opening a buffer in Dired. My idea was to have the hydra trigger the relevant Dired command, that I assumed would exist and look like:

dired-read-buffer "c:/emacs"

As far as I can see, there is no such command in the section in the GNU Emacs manual on invoking Dired. There is more than one way to interactively call Dired, but I want something more programmatic.

How can I implement this?


texts: Distinguish between blank lines at end of buffer and bottom of window?

texts:
Q: how can I get a visual indicator distinguishing between the end of the buffer and the bottom of the window?

Use case: I've got a buffer with some blank lines at the bottom.  However, the bottom of the window beyond the blank lines is also, well, blank.  I'd like to be able to tell, visually, where the buffer ends/blank lines stop.

Vim does this with non-text characters at the bottom of a window (ie, the tildes) to indicate that there is nothing in the buffer (such as of blank lines) in that space, as in the screenshot below:

How would one get the analog of this Vim feature in Emacs?

EDIT: @glucas's answer looks correct, but I'd love to see an answer that does not use the fringe, as I set mine to nil to save screen space on a small laptop screen.


texts:
For unfortunate reasons, I need to write, by hand, expressions that look like the following:

.....((((((((((((((((.....+))))))))[[[[[[[[[[[[[[[[{{{{{{{{{{{{{{{{))))))))+
((((((((]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}((((((((+.....)))))))))))))))).....

This involves parentheses of different types that need, amongst each type, to be balanced without regard to other types.  It would be very convenient if there was a way to get show-paren-mode to disregard mismatches entirely, and only show the matching parenthesis of the same type, but my suspicion is that, depending upon the way it is implemented, this may simply be impossible.

Is there any way to coax show-paren-mode, or some other similar mode, into doing this, or is it going to involve writing my own mode?


texts: Opening an External PDF in Emacs from Terminal

texts:
I am using Emacs on the Mavericks OSX Terminal. I can open the TeX file fine, but I can compile a pdf via C-c C-c. Is there some way that I can open the pdf in an external window via the command line? I tried running C-c C-c and then C-c C-c again, but it said that was undefined. I have also looked here:

https://tex.stackexchange.com/questions/11613/launching-an-external-pdf-viewer-from-emacs-auctex-on-a-mac-osx-fails

But that didn't work either. I would really like to be able to run LaTeX in Emacs from the command line, but I do a lot of live TeXing and I need to continuously check the pdf. Can someone help me fix this problem?


texts: profiler-report seems to be missing data

texts:
I'm trying to profile the usually excellent find-things-fast package to figure out why it's slow in my project.

I started profiling with profiler-start, executed the command that's slow (ftf-find-file), then immediately ran profiler-report.

This generated the following report:

Functions                                                 CPU samples  %
- command-execute                                                1770  88%
 - call-interactively                                            1770  88%
  - apply                                                        1770  88%
   - call-interactively@ido-cr+-record-current-command               1770  88%
    - apply                                                      1770  88%
     - #<subr call-interactively>                                1770  88%
      - funcall-interactively                                    1770  88%
       - ftf-find-file                                           1597  80%
        - ftf-project-files-alist                                1522  76%
         - ftf-project-files-hash                                1330  66%
          - let                                                  1330  66%
           - mapcar                                              1330  66%
            - #<lambda 0x5458e8e0>                               1024  51%
             - let*                                              1008  50%
                cons                                               24   1%
            + split-string                                        282  14%
         + maphash                                                192   9%
        + ido-completing-read                                      67   3%
       + next-line                                                 75   3%
       + ido-switch-buffer                                         41   2%
       + ido-switch-buffer-other-window                            38   1%
       + profiler-report                                           19   0%
+ ...                                                             145   7%
+ redisplay_internal (C function)                                  37   1%
+ timer-event-handler                                              26   1%
  undefined                                                         5   0%
+ gui-set-selection                                                 4   0%
  internal-echo-keystrokes-prefix                                   2   0%

The profiler report seems to blame the let* function within ftf-project-files-hash.

However, looking at that function:

(defun ftf-project-files-hash ()
  "Returns a hashtable filled with file names as the key and "
  (let ((default-directory (ftf-project-directory))
        (table (make-hash-table :test 'equal)))
    (mapcar (lambda (file)
              (let* ((file-name (file-name-nondirectory file))
                     (full-path (expand-file-name file))
                     (pathlist (cons full-path (gethash file-name table nil))))
                (puthash file-name pathlist table)))
            (split-string (ftf-project-files-string)))
    table))

It seems incredibly unlikely that let* is the slow part, but rather one of the functions called within that let*.

Why is profiler-report stopping at let* rather than telling me which component of that let* is slow? How can I dig deeper to find which exactly function is slow?


texts: Org-babel. :flags in C code blocks dont work correctly anymore

texts:
I'm trying to run current code block
#+HEADERS: :includes <math.h> <stdio.h> :flags -lm
#+HEADERS: :var x=1.0 :var y=4.0 :var z=10.0
#+begin_src C  :tangle trying
double pi = 4*atan(1);
double r, theta, phi;
r = sqrt(x*x+y*y+z*z);
theta = acos(z/r) * 180.0/pi;
phi = atan2(y,x) * 180.0/pi;
printf("%f %f %f", r, theta, phi);
#+end_src

And when I try to execute this code, I got an error:
/tmp/ccPySR8b.o: In function 'main':
C-src-uM2yPq.c:(.text+0x5a): undefined reference to 'sqrt'
C-src-uM2yPq.c:(.text+0x75): undefined reference to 'acos'
C-src-uM2yPq.c:(.text+0xb0): undefined reference to 'atan2'
collect2: error: ld returned 1 exit status

I guess, this happened, because babel put the flag before filename gcc -lm code.c, instead gcc code.c -lm. I don't know how to fix it.
Org mode version 9.1.4
GNU Emacs 27.0.50
In fact, I tested this code block on different PCs, and this case have 100% reproducibility.
UPDATE
-lm must be used with :libs option, not :flags, thx @NickD


texts: How do I get ergoemacs-mode set to default without "Symbol's function definition is void: ergoemacs-mode" error

texts:
Running windows 8.1, package intallation went fine.

Enabling with M-x ergoemacs-mode works like a charm, but doing this every time I start up Emacs gets quite tiresome.

adding

(setq ergoemacs-theme nil) ;; Uses Standard Ergoemacs keyboard theme
(setq ergoemacs-keyboard-layout "us") ;; Assumes QWERTY keyboard layout
(ergoemacs-mode 1)

to ~/.emacs as advised here gets me the following error:

Warning (initialization): An error occurred while loading `c:/Users/UserName/AppData/Roaming/.emacs':

Symbol's function definition is void: ergoemacs-mode

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

I don't have a clue about how to do this debug mode properly (get No Match in return), but in the manual I found how to evaluate each expression. using C-x C-e Evaluating first two of the added lines give me nil and "us", and evaluating the last line enables ergoemacs-mode.

in my ~/.emacs I also found this block of code:

 '(ergoemacs-ctl-c-or-ctl-x-delay 0.2)
 '(ergoemacs-handle-ctl-c-or-ctl-x (quote both))
 '(ergoemacs-ini-mode t)
 '(ergoemacs-keyboard-layout "us")
 '(ergoemacs-mode nil)
 '(ergoemacs-smart-paste nil)
 '(ergoemacs-theme "standard")
 '(ergoemacs-theme-options nil)
 '(ergoemacs-use-menus t)

Neither changing '(ergoemacs-mode nil) to (ergoemacs-mode 1), removing that line OR changing '(ergoemacs-mode nil) to (ergoemacs-mode 1) and
removing the other 3 lines works.

Please advise.


texts: How to show the daily tasks in day's agenda but not in week's agenda?

texts:
I have a few tasks in my agenda that I'd like to complete every day, e.g. SCHEDULED: <2016-04-04 Mon 16:30 +1d>.

Obviously I like to see them in the daily agenda, and that works fine. Here's what I'm using:

(setq org-agenda-custom-commands
      `(
        ;; ...
        ("d" "Daily Action List"
             ((agenda ""
                      ((org-agenda-ndays 1)
                       (org-agenda-sorting-strategy
                        (quote ((agenda time-up priority-down tag-up))))
                       (org-deadline-warning-days 0)))))))

(defun orfu-agenda-day ()
  (interactive)
  (org-agenda nil "d"))

However, when I switch to the weekly view (with w), the daily tasks obscure the whole thing, since each of them is now repeated 7 times.

How could I hide all tasks that have +1d in them from the weekly view? If it helps, I could tag the headings they are in with e.g. :daily: and then the problem would simplify to hiding a single tag from the weekly agenda.


texts: do not move window when "left mouse click on empty part of menubar"

texts:
With Emacs GTK, when left clicking with the mouse on an empty part of the menubar, it starts moving the whole window (aka it moves the frame).
Emacs is doing this also, when starting it with emacs -Q.
I would like to rebind this action to another function, but since emacs seems to not register this click. And my Windowmanager is not handling this click, the question is:

Where to search for the function, which tells my windowmanager to move this window?

Emacs-lucid was not doing this, but emacs-gtk does it.
Is this a GTK feature?
But if so: why are other GTK programs, which share the same ~/.gtkrc-2.0 config file, not showing this behavior?
Is there another gtk config file which emacs is using? Because removing the file ~/.gtkrc-2.0 does not change emacs behavior.

More detail on emacs' behavior

A short click into the red marked area (see picture below) makes the frame stick to the mouse pointer until you click again.
And a mouse click drag action, moves the window.

Other GTK programs do not show this behavior. (Edit: This is not the case, I was just checking against GTK2 programs)

As comments show this is not always standard behavior of emacs.

Edit: This question is not just emacs, but related to all GTK3 programs.


texts: How to start emacs with a custom agenda view?

texts:
I can start emacs with my org-mode agenda view by putting the following in my init.el file:

(org-agenda-list)
(delete-other-windows)

Or I can start it with my global todo list:

(org-todo-list)
(delete-other-windows)

But not both. I can define a custom view like so:

(add-to-list
 'org-agenda-custom-commands
 '("z" "calendar + todo"
   ((agenda "")
    (todo ""))))

But how can I start emacs with this custom view loaded?


texts: How do I stop checkdoc from flagging header/footer in org-src-edit buffers?

texts:
When editing Emacs Lisp source blocks in org-mode via org-src-edit, if flycheck is enabled (which I'd like to keep that way) checkdoc rather annoyingly remarks that I'm missing headers and footers and commentaries and whatnot. In checkdoc itself, it seems that if the buffer has a name, it's going to get checked for commentary:
    (or (and buffer-file-name ;; only check comments in a file
             (checkdoc-comments)))

So checkdoc-comments does a couple of useful things, and I'd be sad to see it go entirely, but it's gotta go. I thought some advice could help:
(define-advice checkdoc-comments (:around (original))
  (unless (org-src-edit-buffer-p)
    (funcall original)))

(A better version might filter out the offending errors instead of not checking anything, but I wanted to keep it simple.)
This works great when calling checkdoc manually via M-x checkdoc. Comments are excluded. But somehow, flycheck seems to ignore my advice. I don't understand why, as flycheck's source code doesn't seem to have a special version of checkdoc. Am I not understanding how advice is supposed to work?
Is there another way to do what I want to do?


texts:
I'd like to insert (programmatically) some text right after the point (without moving it).  I came up with this:

(save-excursion (insert "my text"))

It seems to work.  Is it a good way to do what I want?  E.g., are there situations where this could break?  (Other than those where insert would break anyway, like read-only buffers.)  Is it different from what would more experienced Elisp hackers do?


texts: How can I get the value of left top and right bottom point value of current window?

texts: How can I get the value of left top and right bottom point value of current working window(the window currently focusing on)?


texts: How to automatically install Auctex if certain package is unable to be activated on startup?

texts:
every time I git clone my configuration of Emacs into a new machine and start Emacs, there will be error message in Emacs:

error: Unable to activate package 'company-auctex'.
Required package 'auctex-11.87' is unavailable

I know I can fix this problem by package-install auctex manually, but is there a way that I can check if activating company-auctex package failed and then install auctex automatically?


texts: Does installing packages using ELPA or MELPA need some additional steps for installing them manually?

texts:
I want to understand the different ways for installing a package, leading to readily using the package.

I compared Emacs: How to Install Packages Using ELPA, MELPA  and How to Install Emacs Package Manually.

In the second link, if I understand correctly, the steps to install a package manually are

(optional) byte-compilation of the package's elisp code,
loading the package's files, and
auto-activating the mode defined in the package, when opening files which the package is supposed to handle.

In the first link for installing a package using ELPA or MELPA, I don't find any of the three steps for installing a package manually in the first link.

So does the way for installing a package using ELPA or MELPA in the
first link already do the things that are done by the three steps
for installing a package manually in the second link? Or does the
way for installing a package using ELPA or MELPA in the first link
need additional steps that appear in the way for installing a
package manually in the second link?
In the way for installing a package using ELPA or MELPA in the first
link, is it necessary to add something to ~/.emacs.d/init.el?

Thanks.


texts: How can I set face for echo-area message

texts:
When I print messages using (message (propertize "text" 'face 'some-face)) properties get printed as text:

#("text" 0 4 (face some-face))

How can I have faces displayed properly?


texts: `Alt-f` or `Alt-b` then `d` deletes the forward word rather than putting character 'd' in front of the word. Why does emacs behave in this way?

texts:
I was doing some editing in Emacs. I was using Alt-f and Alt-b to traverse by word. I wanted to add the character d in front of a word. So I pressed Alt-b to get to the front of the word and then pressed d. Oops! It deleted the word rather than putting d in front of the word.

Is the expected behavior of Emacs?


texts:
Say I have spacemacs open and now I want to launch some sort of file browser to open a file. How do I do it?

I have found SPC f f which sort of works but the navigation is quite cumbersome. There is also SPC f F but I can't even see a difference.

How do you usually open files?

(I am using spacemacs in vi mode.)


texts: I am using Emacs 25 in SUSE linux and when I switch to a workspace where Emacs is the front window almost none of the text is visible. I have to call redraw-display in order to get it refresh the screen so I can see my text. Is there someway that I could make this automatic? Like whenever Emacs gets focused it calls redraw-display?


texts:
I'm trying to do the same thing as described in (Export an org-mode file as a PDF via command line?) generate a pdf from a org file but want to do it
inside a docker container also. And now I get an error and no pdf.
How do I display the content of the "Org PDF LaTeX Output"

The command I'm currently using is as follows:

docker run \
   -it \
   --rm \
   -v `pwd`:/docs \
   --entrypoint emacs \
   hgjt/emacs-texlive:latest \
   -l /root/emacs.el \
   --visit plot_var.org \
   --batch \
   --eval "(org-latex-export-to-pdf)"


texts: How to disable on-the-fly diagnostics in eglot?

texts:
How can I disable any sort of on-the-fly diagnostics in eglot?
This does not seem to be possible by customizing eglot-ignored-server-capabilites. Disabling flymake-mode using a major-mode-hook also does not work.


texts:
Scenario: I am working in a single window with sql expressions.
----------------------
|  File 1            |
|                    |
| expr 1             |
| expr 2             |
| etc...             |
----------------------

I have a function that evaluates an expression, something like run-psql.
I want an expression to be evaluated in a split window, remaining focused on the first window:
-----------------------
|focus here| result   |
|          |          |
| expr 1   |          |
| expr 2   |          |
| etc...   |          |
-----------------------

How do I achieve that?


texts: Everytime I open emacs with -nw my file is prepended with 0;276;0c. My screen realestate is also being cut in half

texts:
How can I reset the default behavior of no prepending (but still being able to use -nw) and not having the bottom half of my terminal be black space.

Having emacs test.py -nw -Q doesn't solve the issue, emacs test.py -Q doesn't result in the characters but it does produce a window that I'd rather not have.

I'm using emacs within a python jupyter shell, my version is GNU emacs 23.1.1, echo $TERM returns xterm.

As additional clarification, if I fully expand my terminal window, the emacs editor will only fill about half of the space. It isn't being filled with the "help editor" as sometimes happens.


texts:
Is it possible to provide an alias (e.g. m or mes) for a name like *Messages*?

Ideally, I'd like to be able to write some kind of hook that gets called when a buffer doesn't exist and resolves to another name. Transferring control to an arbitrary function lets the user write interesting behavior like bailing out when presented with an ambiguous abbreviation.

Strawman code:

(defun messages-abbrev (ignored-string)
    "*Messages*")

(install-buffer-abbreviation '("m" "mes") #'messages-abbrev)

Ideally, I'd like something that works at a lower level than ido or helm or equivalent, so it can be composed with either of them or none of them. But it is also interesting if those libraries provide a solution to this problem.

An emacs configuration option that globally enables some kind of fuzzy buffer resolution would also be neat if such a thing exists.


texts: Can align-current handle aligning a varying number of columns?

texts:
I'm attempting to write a rule for align-current for Robot Framework tests. Columns are delimited by multiple spaces in a row (I know, what an awful choice) and each row can have a varying number of columns (essentially each column is a function argument). Can this be implemented with align-current?

Here's some example input:

Log  fooooooooooooooooooooooooooo 123 456
Log differently  something else  bazzzzzz

Desired output:

Log                fooooooooooooooooooooooooooo 123 456
Log differently    something else                          bazzzzzz

What I have at the moment is:

(add-to-list 'align-rules-list '(robot-mode-align-test-data
                                 (regexp  . "\\(  +\\)")
                                 (modes   . '(robot-mode))
                                 (repeat  . t)
                                 (spacing . 4))

which works except for the final column on the second line in the example above.

I've tried including \n in the align regex, but I think emacs ends up in an infinite loop (until it hits line length 256 when presumably it gives up).


texts: How do I get Org mode to recognise the \LaTeX{} macro?

texts: I know you can use inline LaTeX in Org, and that works fine for the most part when exporting to HTML. However, I've not managed to get Org to recognise the \LaTeX{} macro properly, unless I enclose it in $\LaTeX{}$—but that exports it in italics, which I don't want.


texts: Align statement breaks on rhs with equal sign

texts:
Is there a way to have rhs statement breaks align with the equal sign on the lhs line?
e.g.

some_value = a * b + c
    / some_other_value * x;

becoming

some_value = a * b + c
             / some_other_value * x;

I can only figure out how to have it a consistent offset, which means that different lhs variable names won't have the rhs equation lines align correctly.


texts: org-capture with reference to file in which it was invoked

texts: Is there a way to configure org-capture so that, if I create a note from within a certain file, it will include a link to that file?


texts:
Is there a way to bind keys across all modes? For example I have one binding:

  (define-key evil-normal-state-map (kbd "gt") 'persp-next)

This works fine in some modes, but not in others, like org-mode, where you have to add a specific binding:

  (evil-define-key 'normal org-mode-map (kbd "gt") 'persp-next)

This works, but it's annoying to have to define bindings for every major-mode. The final option, global bindings, doesn't seem to work at all without accelerator keys:

   (global-set-key (kbd "gt") 'persp-next)


texts: Forcing Speedbar's Sorting Order of Org File Headers to Mirror File's

texts: I use both org-sidebar (https://github.com/alphapapa/org-sidebar/) and Speedbar to navigate Org files.  Both have minor issues.  However, I find Speedbar works best, but it has a terrible habit of sorting headers in an order different to that of the file.  In particular, headings with no sub-headings (such as when drafting an outline) are always displayed after headings with sub-headings.  Does anybody know how to force the headeings' sort order in Speedbar to match that of the file's?


texts: Helm swoop on all project files (not just current buffers)

texts:
So I'm looking to have helm-swoop look at all files in a project,
not just the current set of open buffers.

This is so I can use swoop to find all occurrences in a project, mark relevant ones, then edit them (in helm swoops edit mode).

I feel that there's probably a clean way to do this with Helm/Helm swoop
but here's my attempt to think through a solution:

gather filenames from projectile
create a list of buffers from the filename list
do the same routine as helm-multi-swoop-all besides using this new buffer list

(projectile-current-project-files), looks like it gives me the file list I'm looking for.

So helm-multi-swoop-all, looks like it'd be fairly easy to copy and then tweak.

(defun helm-multi-swoop-all (&optional $query)
  (interactive)
  "Apply all buffers to helm-multi-swoop"
  (cond ($query
         (setq helm-multi-swoop-query $query))
        (mark-active
         (let (($st (buffer-substring-no-properties
                     (region-beginning) (region-end))))
           (if (string-match "\n" $st)
               (message "Multi line region is not allowed")
             (setq helm-multi-swoop-query
                   (helm-swoop-pre-input-optimize $st)))))
        ((setq helm-multi-swoop-query
               (helm-swoop-pre-input-optimize
                (funcall helm-swoop-pre-input-function))))
        (t (setq helm-multi-swoop-query "")))
  (helm-multi-swoop--exec nil
                          :$query helm-multi-swoop-query
                          :$buflist (helm-multi-swoop--get-buffer-list)))

Just replace the call to helm-multi-swoop--get-buffer-list,
to one that provided a list of buffers using projectiles list.

But now I'm a little stuck.
I'm not sure how to create a list of buffers to feed into helm-swoop from a set of file names.

I also can't help but think there's a simpler way to achieve this, maybe without custom functions.


texts: How to make orgtbl-mode use org-entities in other major modes?

texts:
Org mode provides a variable called org-entities that contain replacements for latex symbols like \alpha, \beta etc.

Org also provides a minor called orgtbl-mode which allows text that starts with a | in arbitrary major modes to be interpreted as an org table and then I can do calculations and alignment. I have found this to be a very useful feature.

However orgtbldoesn't seem to use org-entities when I am using it while documenting some math heavy python code. For example I have a function with some detailed logic that I need to program and it would be helpful to get the same kind of feedback while writing my code's documentation that I get in a org buffer. Please let me know how I can achieve this effect. Thanks.

Below is a small table fragment that orgmode renders automatically that contains some "business logic" that I need to code:

| Name      | Symm      | Remarks               |
| \equiv    | \check    | x = y                 |
| \neg      |           | x \cap y = \phi \land x \cup y = D |
| \perp     | \check    | (else)                |


texts: Possible to pass arguments to emacsclient alternate-editor?

texts:
Currently this works:

emacsclient ..args.. --alternate-editor=some_editor

However this does not:

emacsclient ..args.. --alternate-editor="some_editor --args"

Is there a way to call the alternate-editor with arguments?


texts: Insert date using a calendar - where other language rather than english is desired

texts:
I am interested in inserting custom dates using the calendar, I found Insert date using a calendar which turned out to be quite useful. Org calendar : change date language? seems to have no effect (I would also like to avoid setting the variable via seq)

While this code works fine for English dates.

(defun my/org-insert-date-english ()
  "Insert a date at point using `org-read-date' with its optional argument
of TO-TIME so that the user can customize the date format more easily."
  (interactive)
  (require 'org)
  (let ((time (org-read-date nil 'to-time nil "Date:  ")))
    (insert (format-time-string "(W%W) (%a) %d %b %Y"
                                time))))

;; Inserts: (W19) (Thu) 16 May 2019

I was trying to modify it to get it work to insert dates in a different laguage than english.

My modifications below don't work but I am not sure why, could someone pin point what am I doing wrong?

(defun my/org-insert-date-german ()
  "Insert a date at point using `org-read-date' with its optional argument
of TO-TIME so that the user can customize the date format more easily."
  (interactive)
  (require 'org)
  (letf ((time (org-read-date nil 'to-time nil "Date:  "))
         (calendar-week-start-day 1)
         (calendar-day-name-array ["Montag" "Dienstag" "Mittwoch" "Donnerstag"
                                   "Freitag" "Samstag" "Sonntag"])
         (calendar-month-name-array ["Januar" "Februar" "März" "April" "Mai" "Juni"
                                     "Juli" "August" "September" "Oktober" "November"
                                     "Dezember"]))
    (insert (format-time-string "(KW%W) (%a) %d. %b %Y"
                                time))))

;; Inserts: (KW19) (Thu) 16. May 2019
;; Desired: (KW19) (Donnerstag) 16. Mai 2019

Notes:
- Using Emacs 26.2


texts: How to evaluate a list containing strings or un-evaluated blocks into a string? (like format-mode-line)

texts:
The mode-line-format can be a list of strings, but it can also include un-evaluated blocks, e.g:
(setq mode-line-format
  (list
    "Hello"
    '(:eval (my-function-call))
    "There"))

I would like to store a list in a similar format which can be converted into a string.
However I don't want to use format-mode-line as I don't want %p etc.. to have special meanings.
Is there a utility function for doing this? Or would I need to implement the logic to extract/evaluate a string from the list myself?


texts: How to query-replace across all hits in a compilation-mode buffer

texts:
How can I run a query-replace on the all the files pointed to by an arbitrary compilation-mode buffer?

I think to be usable this would need to be resumable from point in the compilation-mode buffer.

Something very nearly exactly functionally equivalent to query-replace would of course be fine, but for the purposes of this question, I'm not interested in alternative UIs such as globrep, multiple cursors etc.


texts: What are the ?\(, ?\[, ?\{ symbols in emacs lisp?

texts:
I've came across this comment in an evil-surround issue, which stated this code:

;; use non-spaced pairs when surrounding with an opening brace
(evil-add-to-alist
 'evil-surround-pairs-alist
 ?\( '("(" . ")")
 ?\[ '("[" . "]")
 ?\{ '("{" . "}")
 ?\) '("( " . " )")
 ?\] '("[ " . " ]")
 ?\} '("{ " . " }"))

And it actually works. but what are those strange ?\ symbols? What are they doing? What do they mean?


texts: org-table, how to compute Coefficient of Determination between two time fields?

texts:
I have two time fields. My productivity and sleep. I would like to run a Coefficient-Determination
(As described here:
http://www.r-tutor.com/elementary-statistics/simple-linear-regression/coefficient-determination )

Is it possible in org-mode?

E.g

|Date | productivity | sleep|
|-----|--------------|------|
|[meh]| 4:00         | 8:00 |


texts: Copy from terminal (tmux) to emacs with color?

texts: I'm currently started using tmux because of getting tired of term-mode, and I managed to shortcut in tmux to open current session output in emacs so I could search and select from it in emacs. I have the only problem - I wish for emacs buffer to display term session output with the same color highlighting - for directories to be blue e.g. As I understand it is doable since term-mode is able of that somehow. Can anyone point me how to copy text with such face overlays from terminal to emacs?


texts: How to make sure no global variables have been created in a piece of lisp code?

texts:
I am writing some lisp code and I would like it not to mess with the global variables in the system.  I am therefore being very careful to only use variables within the scope of the let special form.
However, as the code gets longer, it becomes harder to make sure this principle is being  fully respected, especially since there is the risk of a mispelled variable suddently becoming global in case the incorrect spelling turns the name of a variable into one not bound in any let form.
Ideally it would be great to be able to simply prohibit new global variables to be setq, say with a lisp command inhibit-setting-global-variables-not-already-defined.  My question is thus:
Question.  Is it possible to automatically verify that a piece of lisp code does not create any new global variables?


texts: Distinguish various hyphens: U+00AD and U+2011

texts:
According to the manual, emacs

  displays U+00AD (soft hyphen), U+2010 (hyphen), and U+2011 (non-breaking hyphen) with the escape-glyph face.

Which is fine to distinguish them from the ASCII hyphen/dash/minus character, but I'd like to be able to distinguish these three funny hyphens from each other, too.


texts: Quickly navigate path with evil-mode's ex commands?

texts:
I am new to Emacs. I like how I can easily navigate to a file via helm-mode-find-file in helm.

Is there any way to combine any variant of this (helm or otherwise) with evil's ex commands (eg, :e, :sp, etc.)?  Or do I really have to type the full path by hand every time I am trying to open a file from the hard disk?


texts: org mode, html export of LaTeX equations with tikz support

texts:
In my org-mode file I have some LaTeX equations using tikz and tikz-cd packages:

#+TITLE: Mixing tikz and equations

* An example

\begin{equation*}
\begin{tikzcd}
A\arrow[yshift=.7ex,r,"f"]
 \arrow[yshift=-.7ex,r,swap,"g"] & B
\end{tikzcd}
\end{equation*}

I have added tikz and tikz-cd packages to org-latex-packages-alist with value:

(("" "tikz-cd" t) ("" "tikz" t))

and I have customized org-latex-pdf-process as follows:

(setq org-latex-pdf-process
        '("lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
          "biber %b"
          "lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
          "lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"))

With this configuration, I can export the document to pdf:

However this does not work when exporting html:

If I try to export only the equation fragment (with C-c C-x C-l) I get this error:

  org-compile-file: File "/tmp/orgtexayOYxL.dvi" wasn’t produced.
  Please adjust ‘dvipng’ part of ‘org-preview-latex-process-alist’.

Unfortunately, the org-preview-latex-process-alist variable does not seem easy to configure... and I need help here.

In short: what would be a clean configuration to be able to export my org mode document both in pdf and html?

Update:

I do not know if it helps...

Adapted from https://www.homepages.ucl.ac.uk/~ucahjde/blog/tikz.html

#+HEADER: :file contour.png :imagemagick yes :eval no-export
#+HEADER: :results raw :headers '("\\usepackage{tikz}")
#+HEADER: :fit yes :imoutoptions -geometry 400 :iminoptions -density 600
#+BEGIN_src latex
\begin{tikzpicture}
\draw[->] (-3,0) -- (-2,0) arc[radius=0.5cm,start angle=-180,end angle=0] (-1,0) -- (1,0) arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);
\filldraw (-1.5,0) circle[radius=1mm];
\filldraw (1.5,0) circle[radius=1mm];
\end{tikzpicture}
#+END_src

works for figures, but I would like to make it works for equations.


texts:
I need to have Emacs open a terminal at start-up automatically (in order to use Fish in the terminal and use Emacs to for example search the Fish output).

Normally I do this with 'M-x term'.

Is there a way to make Emacs do this?

I tried adding (term) and (eshell) (as an alternative) in many combinations such as this one:

 1 (visual-line-mode 1)
  2 (global-display-line-numbers-mode 1)
  3 (scroll-bar-mode -1)
  4 (tool-bar-mode -1)
  5 (menu-bar-mode -1)
  6
  7 (require 'package)
  8 (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
  9                     (not (gnutls-available-p))))
 10        (proto (if no-ssl "http" "https")))
 11
 12   (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
 13   ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
 14   (when (< emacs-major-version 24)
 15     ;; For important compatibility libraries like cl-lib
 16     (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
 17 (package-initialize)
 18
 19 (custom-set-variables
 20  ;; custom-set-variables was added by Custom.
 21  ;; If you edit it by hand, you could mess it up, so be careful.
 22  ;; Your init file should contain only one such instance.
 23  ;; If there is more than one, they won't work right.
 24  '(custom-safe-themes
 25    (quote
 26     ("123dcd41949ac04ccbe3cab4caadec7bf0e01a6f85ffa23ff02c4102529b57dd" "53ba7affc1a77f85b89bb54bcc9fee688bab35d413db6309adfeca1890874395" "59e82a683db7129c0142b4b5a3\
    5dbbeaf8e01a4b81588f8c163bd255b76f4d21" default)))
 27  '(package-selected-packages (quote (cyberpunk-theme))))
 28 (custom-set-faces
 29  ;; custom-set-faces was added by Custom.
 30  ;; If you edit it by hand, you could mess it up, so be careful.
 31  ;; Your init file should contain only one such instance.
 32  ;; If there is more than one, they won't work right.
 33  )
 34
 35 (add-hook 'after-init-hook (lambda () (load-theme 'cyberpunk)))
 36
 37 (with-eval-after-load 'org
 38   (setq org-startup-indented t) ; Enable `org-indent-mode' by default
 39   (add-hook 'org-mode-hook #'visual-line-mode)
 40   (add-hook 'after-init-hook #'eshell))
 41
 42 (add-hook 'after-init-hook #'eshell)

This still opens nothing but the main screen anyway.


texts: Publish org entries to Jekyll with a custom header

texts:
I would like to generate a blog by publishing org files to jekyll, as described in the wiki.

The wiki recommends formatting each post like this:

#+BEGIN_HTML
---
layout: default
title: Benighted on the Ben.
excerpt: An unplanned bivouac on Ben Nevis.
---
#+END_HTML
It was early January when six of us travelled up to ....

While this works, it is inconvenient when exporting to other formats.  I am looking for a function (possibly a publish or preamble) that allows me to publish this

#+LAYOUT: default
#+TITLE: Benighted on the Ben.
#+EXCEPRT: An unplanned bivouac on Ben Nevis.

It was early January when six of us travelled up to ....

Into this

---
layout: default
title: Benighted on the Ben.
excerpt: An unplanned bivouac on Ben Nevis.
---

It was early January when six of us travelled up to ....

Has anyone accomplished this?  Does anyone know of a good place to start?


texts: Say if I’ve a buffer, is there a package or hack to track time that’s spent typing/editing on this buffer (ignoring idle time)?


texts: Variable-pitch and fixed-pitch with the same font-size?

texts:
I've learned here that I can customize my variable-pitch font.
For org-mode, I'm using that customization together with the following snippet to get a mix of variable and fixed-pitch fonts:

(add-hook 'org-mode-hook
            '(lambda ()
               (variable-pitch-mode 1)
               (mapc
                (lambda (face)
                  (set-face-attribute face nil :inherit 'fixed-pitch))
                (list 'org-code
                      'org-link
                      'org-block
                      'org-table
                      'org-block-begin-line
                      'org-block-end-line
                      'org-meta-line
                      'org-document-info-keyword))))

Everything except for normal text is displayed in fixed-pitch, which is displayed with variable-pitch. The problem with my solution is that the font-size for both fonts is different and the variable-pitch looks really small and hard to read. How can I adapt my solution so that both fonts have the same size?

(I also have the feeling that my solution is not ideal because I get buffer fontification problems every now and then in SRC blocks when opening files..)

Example image:


texts:
Consider the following in an .org file:

* Meetings
** TODO Meeting Thing                      :meeting:
   DEADLINE: <2016-04-15 Fri 11:00 +1w -5d>
   :PROPERTIES:
   :LOGGING: nil
   :END:

I typically use C-c C-t a few times to mark such entries to DONE, after which Org will reschedule.

However, in this case, Org is rescheduling the entry with an empty date, as follows:

DEADLINE:

Emacs (snapshot) version is 25.1.50.2. Org version is 8.3.3.


texts: how to customize the secondary highlighting in searches

texts:
When I search for text in my buffer, the cursor moves to the first occurrence but all occurrences beyond the first are also lit. E.g. "jumped" in the screenshot below:

Unfortunately, this particular color for the "other" occurrences is very similar to a color used in my Java syntax highlighting and so I would like to customize it to make it stand out more (e.g. perhaps adding a background color too). What do I do that?


texts: How to disable loading message, when I use emacs to open a easycrypt *.ec file

texts:
I use Emacs GUI in Ubuntu, when I use Emacs to open a easycrypt file, for example a.ec, Emacs will show a loading message at the bottom of the window, I guess it is in the minibuffer, but I am not sure.  Could you please let me kown how to disable or modify this message? I have already disabled message buffer, and put

(setq inhibit-startup-screen t
      initial-buffer-choice  nil)

(setq inhibit-startup-message t)

(setq inhibit-startup-message t)

in my ~/.emacs file, but the message still there when I open .ec files.


texts: Eshell simple echo in parenthesis not working

texts:
Why doesn't the following work in eshell

$ (echo "foo")
Symbol's function definition is void: echo

What I tried:
googled eshell parenthesis not working

More Context:
    Eventually I'm trying to run (source functions.sh; myCoolFunc)


texts: How to regex match words? (in multiple languages)

texts:
I have a simple regex search which matches [A-Za-z], however I would like it to match other characters which would be used in dictionary words for non-english languages. e.g. ü, Ø, ɵ 人参, while excluding:

White space.
Punctuation.
Numbers.
Other non-language symbols arrows, characters for drawing diagrams ... etc.

How can Emacs regex match against unicode words used in language?

I tried [:word:] but this matches numbers.


texts: Add browser bookmark to bookmark browser

texts:
What I mean is, can I add a URL to my Emacs bookmarks, such that selecting the bookmark runs the URL through browse-url?

Desired behavior

What I would like is a bookmark-set-url function that prompts for a url, say emacs.stackexchange.com. Then when I run bookmark-jump, emacs.stackechange.com appears in my bookmarks, and selecting it runs (browse-url "emacs.stackexchange.com").

This is analogous to bookmark-set, which sets a bookmark that points at the current location.

Is this behavior—or something similar—available in Emacs? If not is it possible to augment bookmarks (or bookmarks+) to support it?

The reason I want this is that bookmark-jump feels like a general purpose targeted navigation command. Browser URLs feel like an extension of that idea, despite the fact that they switch to a different application.


texts: How do I replace html  tag contents from one html file to another html file

texts:
I am having difficulty with bibliography citations in HTML export.  I am able to generate two html files with citations, one from the standard html export from an org file, and another from exporting the org file to latex then compiling it with bibtex, again with latex, then with latex2html.  However the latex converted html file is not how I would like so now I am doing some post-processing to combine the two files.  I just want to replace the citations in the standard org html export with the citations in the latex2html export file.

What I have been trying to do now is swap out the content inside all of the   tags from the latex exported html file to the other using emacs.

I have played with using (libxml-parse-html-region (point-min) (point-max)), which creates an output like this:

 (body nil "\n\n"
        (h1 nil "Sample HTML")
        "\n\n"
        (p nil "Once upon a time... blab blab.")
        "\n\n"
        (p nil "large text of other things here... ")
        "\n\n"
        (p nil "more complex non Q and A HTML code here.\ntest\n")
        "\n\n"
        (h2 nil "Questions and Answers")
        "\n\n"
        (p
         ((class . "q"))
         "Q: How Why What is this and that ...?")
        "\n"
        (p
         ((class . "a"))

However I am not sure how to access, change, and swap the values between the two files.  I'm not finding anything on the internet how to do that.

I want to swap these citations.
org html export makes incorrect formatted citations

 ...pri  [Adams].

latex2html output correctly makes the citation

ntegre inermis (Adams,&#x00A0;1993) V...ri stet omnes

Notice how the latex2html citation is the correct format.  The org-export citation has a "[Author]" around all of them.  There is other stuff in the org latex export file that I want though and the latex2html puts in a lot of other stuff I don't want.
Thanks in advance.


texts:
I wish to remove selection programatically, what is the proper way of doing this? Specifically I wish to write a function to make swiper search in buffer with selected text, but it needs to remove selection before open swiper window. Here's the function

(defun sandric/swiper-or-region (beg end)
  "Swiper region or 'empty string' if none highlighted."
  (interactive (if (use-region-p)
                   (list (region-beginning) (region-end))
                 (list nil nil)))
  (if (and beg end)
      (progn
        (keyboard-quit)
        (swiper (buffer-substring-no-properties beg end)))
    (swiper)))

As you can see there's a (keyboard-quit) call before swiper command to open swiper buffer, but with that it simply discards swiper buffer as if ESC was called already after swiper buffer appeared. So I need to find a better way.


texts: Change buffer background color on LaTeX compile error, or highlight errors more prominently?

texts:
I am using Emacs+Auctex to write LaTeX code.

When compiling a document that contains an error, Emacs writes

LaTeX errors in ‘*~/doc output*’. Use C-c ` to display.

to the Messages buffer (and displays it below the mode line). I often overlook this and continue to work on an erroneous document.

Is it possible to configure Emacs such that the background color of a LaTeX buffer is changed (e. g., to light red), if a document is compiled that raises an error? And the color changes back when the error is fixed and the document is re-compiled?

Alternatively, are there any other, possibly simpler, ways to highlight LaTeX compile errors more prominently?


texts: Complete in-progress merge with the --no-verify option

texts:
Often when I'm merge the upstream branch into my branch I'll need to fix up some merge conflicts. At that point I have an in-progress merge. When I fix the conflict and hit m to complete the merge there is no --no-verify option available. The only options are merge and abort.
--no-verify would be useful because often the upstream code has changes that will fail my pre-commit hooks (style linters, etc).
Is there a way to add --no-verify when completing an in-progress merge?


texts:
I was trying to re-structure my latex document but I failed to do it in a single query regex.  My goal was to the following transformation:

\item[root] → \item \textbf{root}

I tied grouping the content withing the brackets and then using in the replacement but it did not work.

This was my attempt:

Alt-S-% \\[\(.*\)] RET \\textbf{\1} RET

I tried playing with the regexp-builder but it seems to have a slightly different syntax than then replace-regexp command.


texts:
I am new to org mode, so it might be a very simple matter, but I couldn't find/figure out it myself.
Say, I have created a few horizontal and vertical windows. Opened an org file which has some source code blocks. Then I wanted to edit one of the blocks by going into Org-Src mode using C-c ' and exiting from it using C-c '. First time I enter C-c ', all other windows in my frame closes, only the org file window stays and a new window which holds the source blocks opens. This is fine although I would prefer it to utilize some opened window. The 2nd time I use C-c ' to exit from Org-Src mode, the org src window closes, the org file window goes maximized/takes up the full frame. This is what I don't want. When I used C-c ' the 2nd time, I wanted to exit from Org-Src mode and restore my previously opened windows. I looked at manual page of Org-Src mode but the only thing I found useful was the hook function, but I don't know how I can utilize that to restore the windows after exiting from org src edit mode.
Emacs version - 27.1
Org Mode version - 9.3 (release that comes with emacs itself)
OS - Windows 10 and Linux

Question: How to restore previous window layout after quitting org-edit-src-code(C-c ') ?


texts: Gnus: How to strip all html tags from incoming mails

texts: I want gnus to remove all html tags from incoming mails, displaying only the text. How do I do that?


texts: How can I get some environment variables into init.el to construct file paths?

texts:
I want to synchronize my emacs configuration through an identical init.el but needs some settings defined according to the host.

For instance although init.el will be the same custom-file will vary by account and host, but will still have to be in the same version control repo so I want something like this for the custom-file, this example using shell syntax

(setq custom-file "~/.emacs.d/$USER_$HOST_custom.el")
(if
    (file-exists-p custom-file)
    (load custom-file)
  )

What would be the idiomatic elisp for such a construct?


texts: How do I change a key binding which also has its own prefix key?

texts:
I want to change a couple of key bindings for @wasamasa's eyebrowse package, because I'm on a laptop and the keys < and > aren't easy to access.

The thing is, this package defines a custom prefix for all bindings (C-c C-w). This confuses me because I don't know if a normal

(define-key eyebrowse-mode-keymap (kbd "z") 'eyebrowse-prev-window-config)

will do the job.


texts: How to remove visible margin on the sides of the echo area?

texts:
I have a question that might be unique. I am new to emacs, so please forgive me (or point me in the right direction) if I missed something obvious or say something wrong.

My problem is that I have made my echo-area a darker color than its surrounding, and now I can see a gap on the sides of the echo area. If I could color that area, or delete the padding/border that is causing that gap, or anything else to remedy the situation, I would be happy to hear it.

I will attach a picture and provide some potentially not useful context below.

I have disabled my mode-line, and I am using the symon package to put the mode line info in the echo area.

I have colored the echo-area using

(with-current-buffer " *Echo Area 1*" (face-remap-add-relative 'default :background "#222"))

and it only (currently) colors the idle mode.

I am using the "doom-one" theme from the "doom-themes" package. The picture shows the left side but both sides have this gap.

Let me know if there is any other info I should provide. Thank you for your time!


texts: Unable to install ElPy: "eval-buffer: Cannot open load file: No such file or directory, s"

texts:
I followed the instructions to install ElPy from source: I cloned the repo to ~/code/elpy and added these to the Emacs initialization file:
(add-to-list 'load-path "~/code/elpy")
(load "elpy")
(load "elpy-rpc")
(load "elpy-shell")
(load "elpy-profile")
(load "elpy-refactor")
(load "elpy-django")

And I get this error in *Messages*:

Loading ~/code/elpy/elpy.el (source)...
eval-buffer: Cannot open load file: No such file or directory, s

with no more details.
How can I install ElPy on Emacs 27.1 (9.0) and macOS 10.14.6?


texts: How to disable multiple elpy keybindings?

texts:
There are multiple elpy keybindings that I am not using. Is there any way to unbind them?
Possible bindings that I want to disable C-c C-t, C-c C-p.
I have tried following answer Globally override key binding in Emacs but it did not help.

I have also tried following, which did not work. Still does keybindings are bind to elpy.
(global-set-key (kbd "C-c C-t") nil)
(global-set-key (kbd "C-c C-p") nil)


texts: Select which nodes are folded in org mode files when opened

texts:
I understand that #+STARTUP: property can control the fold/unfold setting in file level when the org file is loaded. But I need it be more granular.

I wonder if it is possible to set it in node level? for example, *node1 has all subitems unfolded, and *node2, *node3 have all subitems folded?


texts:
I've a small problem with ERC, if I go away from keyboard for a while, it automatically disconnects the channels I've logged into and when I reopen emacs, it reconnects to the channels automatically. But I do not want this to happen. I want the erc channels to be kept alive even if I'm, away for any period of time. How can I achieve this?

ps. I'm on macOS Sierra


texts: Stop org-mode from defining agenda files in custom

texts:
I have the following line in my .emacs:

(setq org-agenda-files (directory-files "~/org-files" 'absolute "[^#]*.org$" 'no-sort))

I would like for org-agenda-files to be defined in this way on startup. However, a (custom-set-variables '(org-agenda-files ...)) keeps getting populated, which means that whenever I remove .org files on another computer, I get hit with Non-existent agenda file messages. How can I remove this persistent behavior?


texts: How to get the position after matching and replacing a regular expression (replace-match)?

texts:
SHORT
How to substitute (nicely) a regular expression by a string in pure elisp, like the unix command sed.

LONG
I'm using the function replace-match after string-match, but I can't get the right position/index (i.e the offset to start the next search) for string-match after the replacement. So I'm in an infinite loop.
I'd like to know how to get directly the position after the replacement.

Of course I could trick by setting the offset to start next search by adding the lengh of the new text, but I don't think it is the correct way.

Here is my code which does an infinite loop

(let ((pos1 0) ;; position of last match
      (str1 "bar") ;; string input
      (regexp1 "a") ;; the regular expression
      (newtext1 "aa")) ;; the new text
  (while (string-match regexp1 str1 pos1)
    (setq str1 (replace-match newtext1 t t str1 nil))
    (setq pos1 (match-end 0)))
  (message "%s" str1))

For example, if I add code to set the limit to 3 loops I will get the output
"baaaaaar"
while it should be
"baar".

EDIT : replacing (setq pos1 (match-end 0))) with (setq pos1 (+ (match-end 0) (length "newtext1"))) does the job, but it is a trick I find inelegant.


texts:
I use browse-url/browse-url-firefox to open links in Firefox from within Emacs 24.5.1 under Linux (Fedora 23) which in essence executes the firefox executable with the URL by start-process.  If there is already a Firefox instance running, this will in turn cause the URL to be opened in a new tab and terminate the firefox executable spawned from Emacs, but otherwise a new Firefox instance will be running as a process child of Emacs (for testing purposes, this is equivalent to M-! sleep 1h & RET).

If I then want to exit Emacs, it asks me "Active processes exist; kill them and exit anyway?" with the option to either kill the Firefox instance or, well, leave Emacs running.  Instead I would like to "detach" the firefox process from the Emacs parent so that I can exit Emacs while keeping the Firefox instance running.

Is it possible to spawn processes from Emacs that "survive" exiting Emacs, or must all spawned processes die when Emacs exits?


texts: Enabling all Emacs keys in Evil's insert and replace states

texts: I tried Spacemacs recently and I really liked the idea of their hybrid mode. But sadly, I can't figure out how to do a few things in Spacemacs so I'm thinking of just using Evil in regular Emacs. So, I'd really like to know if there's a way to enable Emacs movement and text-editing keys in Evil's insert and replace states. Has anyone tried this kind of thing? Any pointers would be appreciated.


texts: emacsclient flashes already-open file for ~2s before showing target file

texts:
My .emacs file opens itself so that I can always switch buffers to quickly make changes. I do this with:

;; $HOME/.emacs
(find-file "~/.emacs")

I start emacs with emacs --daemon and open files from the command line with emacsclient -c <FILE_NAME>.

However, when I open those files, my (already open) .emacs file will flash for about two seconds before opening the file I actually care about.

How can I remove the two second "flash of my .emacs file" and instead make emacsclient immediately show the file I care about?


texts:
I would like an emacsclient frame with a specific name to open when I log into my computer. I tried adding emacsclient -e '(select-frame (make-frame (quote ((name . "scratchemacsframe")))))' to my startup applications, but the frame never opens. If I try running this command from the CLI before opening any other frames, I get this error: *ERROR*: Unknown terminal type. Poking around on Google suggests that this is because the emacs daemon doesn't yet know where to draw the frame. If I change the command to add a -d $DISPLAY, my frame opens, but I also get a second undesired frame that opens to *scratch* for some reason.

How can I make emacsclient open a single frame with a specified name before any other frames are opened?


texts: emacsclient -c new frame cannot have an individual new sr-speedbar

texts:
Since emacsclient depends on emacs server, when I first start emacs server and then try:

emacsclient -c -n -a emacs --eval "(sr-speedbar-open)"

It reports that sr-speedbar is arlready opened. Is it possible to have individual sr-speedbar for every emacsclient -c new frame?

Right now the best I can do is to first close sr-speedbar then reopen it in a new frame.

emacsclient -c -n -e "(progn (sr-speedbar-close) (sr-speedbar-open))"

But sr-speedbar will be closed in all the other frames.


texts: How to customize mu4e-context's shortcut?

texts:
mu4e-switch-context seems to set shortcut key from first letter of its name.

How can I customize this to other letter?

e.g.) I have contexts like "work-A", "work-B", "work-C", ... and pressing ";" shows them all like [w]ork-*.


texts: Why is this snippet working properly, and not here?

texts:
I stumbled upon this feature for functions, and was eager to try it out.

However, I ran into an error message, after trying the snippet in python-mode:

[yas] elisp error: Symbol’s value as variable is void: text

From what I read on his blog, and seeing the others trying this snippet, it went propably without any problems for them. I couldn't figure out how I could bind any value to the text. Any suggestion?


texts:
Emacs 26.1

I have this text:

"ADA-SGD"
"ADT-SGD"
"ADX-SGD"
"AID-SGD"
"AMP-SGD"
"ANT-SGD"
"ARDR-SGD"
"ARK-SGD"

I want to swap text in all these lines. The result must be like this:

"SGD-ADA"
"SGD-ADT"
"SGD-ADX"
"SGD-AID"
"SGD-AMP"
"SGD-ANT"
"SGD-ARDR"
"SGD-ARK"

How I can do this?

Thanks.


texts:
Can I disable this kind of a popup?

I couldn't find anything besides (setq x-gtk-use-system-tooltips nil), but it didin't help me unfortunately.


texts: How to disable `clean-aindent-mode` in spacemacs configuration

texts:
I noticed that clean-aindent-mode is messing up the indentation as I am writing python files. Hence, I wanted to disable this mode, at least when using python mode.
I can manually disable this mode, but I was wondering what the correct code was to disable clean-aindent-mode in my spacemacs configuration file? I imagine it is something simple, but I don't really know emacs lisp.
Thanks.


texts: Reference the last column / row in an org-mode table

texts:
The Situation: I read the Org Spreadsheet tutorial but couldn't find an answer.  Commonly, I want to have the result of a formula in the last row of a table, i.e., have something like

#+TBLFM: @LAST$2=somefunction(...)

This means that in the formula, I will have to do something like vmean(@2..@LASTBUTONE)

The Problem: Now, this becomes tiring when adding new rows above the last one, because it means I'll have to remember to change the row references.

My Question: Is there a way to reference the last or last-but-one row in a way that doesn't break when adding rows above the last one?


texts: What's the fast way to navigate to MAC OSX "Finder"?

texts: On Mac OSX, I'm editing a file in an Emacs buffer.  I need to conveniently open the directory containing this file in the MAC OSX Finder.  What's the best way to do this?


texts: emacs deamon how to keep mode-line-frame-identification at 1

texts:
Each time when I open a new file using emacsclient -t -q file.txt, mode-line-frame-identification number keep increases. What is the reason for it, and can I reaccess to previously numbered frames?

-UU-:---F1
-UU-:---F2
-UU-:---F3
...
-UU-:---F50

Is it possible to keep it at 1, or when emacsclient starts connect to F1 instead of incrementing its value?


texts:
I have the following in my init file

(defun message-buffer-file-name-or-nothing ()
  "Mode line proxy."
  (if buffer-file-name
      (message "[%s] %s"
           (format-time-string "%H:%M:%S")
           (buffer-file-name)))
  )
(add-hook 'focus-in-hook 'message-buffer-file-name-or-nothing)

and it worked great, until recently when it started echoing NOT the file-name of the buffer I was switching to but instead the file-name of the bufer I was switching FROM. I have no idea what happened since I didn't tamper with anything and I can't recall updating emacs recently either (25.3.1).

Output of C-h v focus-in-hook is message-buffer-file-name-or-nothing, nothing else hooks it. I guess this gets executed before buffer-file-name gets updated? But this is weird since it didn't work like this previously. Anyone have any ideas on how to troubleshoot this?


texts: orgmode, capturing original document title

texts:
I have a basic capture template:

("a" "Article" entry
(file+headline "~/GitLab/Reports/Bibliography/references.org" "Article")
"* %^{Title} \n%?")

that asks you to fill the Title field.

Now, my question is how to automatically fill this using the title of the original document (the original #+TITLE my title). One must certainly use sexp with something like:

("a" "Article" entry
(file+headline "~/GitLab/Reports/Bibliography/references.org" "Article")
"* %(...some elisp instructions...) \n%?")

The problem is that I do not find/know a function returning the title.

I mean:

("a" "Article" entry
(file+headline "~/GitLab/Reports/Bibliography/references.org" "Article")
"* %(org-capture-get :original-file-nondirectory) \n%?")

fills with the original file name, but the equivalent for title:

%(org-capture-get :title)

does not exist.

I also try, from an org-mode file:

#+TITLE: Titi Toto

#+BEGIN_SRC emacs-lisp
(plist-get (org-export-get-environment) ':title)
#+END_SRC

#+RESULTS:
| Titi Toto |

but

(plist-get (org-export-get-environment) ':title)

does not work anymore when used in the capture template.

Any help is welcome


texts: How to override background to black after load-theme?

texts:
I am using the monokai theme from https://github.com/oneKelvinSmith/monokai-emacs, and I would like to override the background to be black. Following the override instructions, I tried:

(setq monokai-background "#000000")
(load-theme 'monokai t)

However, this does not seem to work. What am I missing?


texts:
Is it possible to write an org table colmun formula which calculates the running total of some other column? Here is a simple example of the idea: The table

|  1 |   |
|  2 |   |
|  5 |   |
| 10 |   |

should be endowed with a column formula which gives the resulting table

|  1 |  1 |
|  2 |  3 |
|  5 |  8 |
| 10 | 18 |


texts: Evaluate JavaScript source block in org-mode

texts:
If I attempt to evaluate a JavaScript source block then I have to return a value to get a result.  For example:
#+begin_src js
  return 1 + 2;
#+end_src

#+RESULTS:
: 3

That's a bit unusual.  I guess that the code block is treated as the body of a function.  Should I have to use return to get the result of this expression?


texts:
I frequently work with Protein Data Bank files.  These are text files that contain atomic level structure information of molecules.  They can be recognized by their '.pdb' extension.

Whenever editing them in Emacs (GNU Emacs 24.3.1), in the main buffer I see a small box in the top left corner and the minibuffer has the instructions, "Type C-c C-c to view the image as text."  In the bar between the minibuffer and the main buffer, it list that the mode is (Image[imagemagick]).  After pressing C-c C-c, this mode changes to (Fundamental Image[imagemagick]).  It has got to the point where I quickly type C-c C-c almost without thinking about it to view and edit the text file but I would rather not have to.  How do I make it default to the (Fundamental Image[imagemagick]) mode?  I would think I could add some hook to my init.el file but I am not sure what.

Here is an example of text that when saved as test.pdb produces the behavior described:

ATOM      1  O5' CYT X   1      32.071  -1.490 114.864  1.00  0.00      DNA1 O
ATOM      2  C5' CYT X   1      30.711  -1.577 114.398  1.00  0.00      DNA1 C
ATOM      3  C4' CYT X   1      30.171  -0.188 114.035  1.00  0.00      DNA1 C
ATOM      4  O4' CYT X   1      30.040   0.620 115.241  0.00  0.00      DNA1 O
ATOM      5  C1' CYT X   1      30.111   1.904 114.881  0.00  0.00      DNA1 C
ATOM      6  C2' CYT X   1      31.383   1.832 114.043  0.00  0.00      DNA1 C
ATOM      7  C3' CYT X   1      31.091   0.649 113.121  1.00  0.00      DNA1 C
ATOM      8  O3' CYT X   1      30.453   0.939 111.890  1.00  0.00      DNA1 O
ATOM      9  P   THY X   2      29.768   2.098 111.098  1.00  0.00      DNA1 P

I noticed that when opening files in a terminal using the 'no window' option, emacs -nw test.pdb, it opens using (Fundamental Image) mode, without the [imagemagick] part.  I am not sure the difference but if I would be happy if I could get that behavior in the windowed version (I do not intend to only edit within the terminal).

I do wonder why Emacs tries to render the file as an image.  It is clearly related to having ImageMagick installed but I am not sure the specifics.  Does anyone know if it actually can correctly read and render the molecule/s contained in pdb files?

Searching Google for a solution, I see several hit regarding python interactive debugger, the pdb package, and using that from Emacs.  Obviously that is not what I am looking for.

This behavior has been consistent over multiple Emacs updates for the past several years on several computers but the specific version info for the Emacs I am currently using is the following: GNU Emacs 24.3.1
 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian.

If you have recommendations of better Tags which will help this get seen by people that would have input, please let me know.


texts: Undefined control sequence \uline in exporting org-mode with underline markup to PDF using xelatex

texts:
For the following sample,

#+LATEX_CMD: xelatex
#+LATEX_HEADER: \usepackage{xltxtra}
#+OPTIONS: ^:nil

This is a _test_

The export to PDF uses xelatex would produce the following error:

! Undefined control sequence.
l.28 This is a \uline
                     {test}
?
! Emergency stop.
l.28 This is a \uline
                     {test}
No pages of output.

If I use pdflatex then there is no such error. (I have to use xelatex for exporting text with Chinese.)

What would be the solution with xelatex?


texts: Process input seems buggy in Emacs on OS X

texts:
I have a process that I'm trying to send input to on OS X. I'm using Emacs' builtin functions for doing this: process-send-string and process-send-region. However, it seems that there are issues when doing this on OS X. Specifically, it seems that I cannot send a process more than 1 KiB of data. To demonstrate what I mean, here's an example.

I started an Elisp REPL with M-x ielm and ran the following command:

ELISP> (start-process "cat" "*cat*" "cat")
#<process cat>

Then I ran this (no reason I'm using f; it's just a letter I thought of):

ELISP> (process-send-string (get-process "cat") "fff\n")

And I got what I expected in the *cat* buffer:

fff

Now, what if I send this:

(process-send-string (get-process "cat") "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n")

That is a string of 1,024 f characters (which is 1 KiB), followed by a newline so that cat knows that's the end of the input line. That is a grand total of 1,025 bytes which is just over 1 KiB. When I run the above command, all I get in the *cat* buffer is:

^G

It is highlighted so I know that it's a control character. Specifically, this is the ASCII BEL which is number 7. I guess this means that Emacs is getting an error in its write call to cat. The cat process is still alive, though.

According to errno.h, 7 is the error number for the POSIX E2BIG error. E2BIG is described like so in man 2 intro:

7 E2BIG Arg list too long.  The number of bytes used for the argument
and environment list of the new process exceeded the limit NCARGS
(specified in <sys/param.h>).

However, NCARGS is defined as ARG_MAX in param.h. ARG_MAX is defined as 256 * 1024 in syslimits.h, which is 256 KiB. So it seems that I shouldn't be having this problem since my input size is well within the bounds. However, I notice the following settings which are also defined in the system headers:

syslimits.h:81:#define  MAX_CANON        1024   /* max bytes in term canon input line */
syslimits.h:82:#define  MAX_INPUT        1024   /* max bytes in terminal input */
...
syslimits.h:91:#define  PATH_MAX         1024   /* max bytes in pathname */
...
dirent.h:100:#define __DARWIN_MAXPATHLEN    1024
...
_types/_fd_def.h:42:#define __DARWIN_FD_SETSIZE 1024

All of these constants are set to 1024. I wonder if one of them is causing this errant behavior with cat described above. However, this doesn't happen in the terminal. It seems to be specific to Emacs.

Also, as a sanity check, I tested the exact same code in Emacs on Linux and found that everything behaves as expected. I can send well over 1 KiB to a cat process on Linux without a hitch. So is this an Emacs bug or an OS X bug? And more importantly, how can I fix it?


texts:
In org-mode, when I press C-c C-q and I don't have a header anywhere but just have a filetags section defined:

#+FILETAGS:

then I get the error:

org-back-to-heading: Before first headline at position 52 in buffer CAPTURE-20200608211317-test5.org

What I would like is that I get the nice interactive tag selector popup and can set my filetags like that.

The only work-around is now to start a:

* headline

and store the tags there.


texts:
I am using the helm-projectile setup from prelude and it has been a huge improvement to my workflow. The only remaining issue are auto-generated files (e.g. generated by CMake) which show up during helm-grep and similar operations.

Question: is there a way to exclude files in the projects folder tree from Projectile?


texts: Current path in Dired or Dired+ to clipboard

texts:
Say we have a Dired buffer open on some directory. How can I send the directory path to the clipboard?

Also, how can I do the same when the Dired cursor is on a specific file, without opening the file first?


texts:
If you enable Delete Selection mode, a minor mode, then inserting text
  while the mark is active causes the selected text to be deleted first.
  This also deactivates the mark. Many graphical applications follow
  this convention, but Emacs does not.

EmacsWiki

Why? What kind of Emacs workflow is advantageous in not having this as a default?


texts: open multiple files in tabs from command line

texts:
Emacs-27.1 ships with a new tab-bar-mode minor mode. This puts a tab bar at the top of each Emacs frame. Each tab in the tab bar can display multiple windows.
Is there any way to invoke Emacs from the command line and have it open multiple files in separate tabs?
For instance, I want to run a command like the following:
$ emacs --some-flag file1.txt file2.txt file3.txt

Emacs should open file1.txt, file2.txt, and file3.txt in separate tabs (instead of separate buffers).  Is there some way to get this to work?

Vim has a -p flag that allows it to open files into separate tabs instead of just separate buffers.


texts: Column view column widths vary by heading face

texts:
I am running a config of the develop branch of spacemacs on two different machines. Configs are similar but not the same. On one box org mode column view looks fine. I think this is because on starting column view the font changes from varying sizes depending on the header level, to a fixed size, so all good there. However on entering column view in the other instance, there is no change in font sizes, so level 1 > level 2 etc. Therefore the individual columns do not all appear aligned. I am not aware of having done any face customisation...
How can I get my column alignment back? I am guessing it's something straightforward as both my configs are fairly small / simple and pretty much identical.


texts: Is there a way to have in a org-mode file a placeholder for the current date automatically updated when saved?

texts:
(I'm aware of "Creating timestamps", but my point is to automatically update such timestamps distributed in several places in the file.)
I'd like to have in a org-mode file a kind of placeholder for the current date (at the YYYY-MM-DD format), which is automatically updated when the file is saved.
Is it possible?
Edit
Here is the context of my question: I'm in the process of writing a LaTeX class using org-babel for the literate programming. In several places of the file .org file, I have to insert the release date of this class, at least in the exported README.md file like this:
Release
-------
2021-05-10 v1.0.0-alpha

and in the exported .cls source file of the class, like this:
\ProvidesExplPackage{my-nice-class}
{2021-05-10}
{v1.0.0-alpha}
{
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
}

Because I'm likely to forget to update this date before the actual release, I'd like it to be automatically updated each time the .org file is saved.


texts: Incorrect font locking/syntax hightlighting in c-mode

texts:
I've recently started using Emacs, and I'm having a problem with the font-locking in c-mode.
I'm using the Monokai theme, and I'm finding that some tokens are being coloured incorrectly.

The problem is that built in functions (strlen, malloc, strcpy) aren't being recognised and highlighted in the correct colour.

It also seems to think that the n in the call to malloc in the second function is a type.

I'm not really sure where to turn with this, so I'd appreciate any help in sorting this out.


texts: Insert code chunk in R Markdown with yasnippet and polymode

texts:
I am trying to write a yasnippet to insert code chunks into an R Markdown file. I use polymode to have multiple major modes (markdown, ESS[S]) in a single file. This is my snippet:

# -*- mode: snippet -*-
# name: chunk
# key: chunk
# --
\`\`\`{r $1}
$0
\`\`\`

When I try to insert the snippet into a .Rmd file in markdown mode, I get this error:

Error in post-command-hook (yas--post-command-handler): (error "Marker points into wrong buffer" #<marker at 7 in test.Rmd>)

The snippet does appear and my cursor is in the correct spot (right before the second curly brace):

```{r }

```

When I hit tab I get the following:

yas-next-field: Wrong type argument: overlayp, nil

I am guessing that I'm running into an interaction with polymode: I'm in markdown mode when I insert the snippet, but then polymode converts the contents of the code chunk to ESS[S] mode. It looks like there will eventually be a command to insert a new chunk in polymode, but in the meantime is there any way to get this snippet working?


texts: How do I get the closest property change before a given point?

texts:
How can I get the previous-or-equal single property change for a given property? For example, assume AAA, BBB, and CCC below have different faces.

AAABBBCCC

Here is the return value that I would like to get for each position:

AAABBBCCC
111444777

Contrast to what previous-single-char-property-change returns:

AAABBBCCC
111144477

Essentially, the problem is that (previous-single-char-property-change (point-max) 'face) returns 4 instead of 7. I thought I could just use (previous-single-char-property-change (1+ (point) 'face) instead, but that breaks on (point-max), unfortunately.

How can I achieve get the previous-or-equal single char property change, taking into account the starting position?

Here is some code to reproduce the example:

(with-current-buffer (get-buffer-create "*test*")
  (erase-buffer)
  (insert "AAABBBCCC")
  (mapc #'delete-overlay (overlays-in (point-min) (point-max)))
  (overlay-put (make-overlay 1 4) 'face '(:background "red"))
  (overlay-put (make-overlay 4 7) 'face '(:background "blue"))
  (overlay-put (make-overlay 7 10) 'face '(:background "green"))
  (pop-to-buffer (current-buffer)))

Some background: for a major mode that I'm writing I need to read information from the overlay (if any) that precedes (and does not cover) the current point.


texts: org-mode setting to preserve spacing in SRC code, with verbatim latex output to pdf

texts:
Like this post, when I indent within a SRC code block in org-mode, 8 consecutive spaces are converted to a tab. Moreover, when I export to LaTeX 8 consecutive spaces are converted to tabs in the resultant .tex output. This is a problem as my
LaTeX (pdflatex / xelatex) convert tabs in verbatim mode to a single space. This means my source code's indentation is off. A http://tex.stackexchange.com poster was told to use fancyvrb, but that doesn't immediately solve my problem.

I want to use org-mode to write these documents, C-c ' to edit source blocks, and C-c C-e l p to turn my org-mode files into pdfs.

What options do I have to, for instance:

make org-mode SRC blocks export as fancyvrb's Verbatim mode OR
prevent my org-mode's indentation mechanism and my export to LaTeX from turning 8 spaces into a tab OR
post-process the exported LaTeX and transform the tabs into 8 spaces?

And how can I make this setting the default for my org-mode? I would like not to have to include this same boilerplate in all of my org-mode files that I intend to use with it, and I would like to avoid having a special latex compilation command to have to use for the tex files I generate.